Explorar el Código

Fix a crash on exit caused by shader deletion.

legacy
Sam Hocevar hace 5 años
padre
commit
00d7d2a774
Se han modificado 2 ficheros con 1 adiciones y 6 borrados
  1. +1
    -1
      src/lol/gpu/shader.h
  2. +0
    -5
      src/mesh/mesh.cpp

+ 1
- 1
src/lol/gpu/shader.h Ver fichero

@@ -314,7 +314,7 @@ private:
class ShaderData;

//Shader ----------------------------------------------------------------------
class Shader : public Entity
class Shader
{
public:
static std::shared_ptr<Shader> Create(std::string const &name, std::string const &code);


+ 0
- 5
src/mesh/mesh.cpp Ver fichero

@@ -61,13 +61,10 @@ SubMesh::SubMesh(std::shared_ptr<Shader> shader, std::shared_ptr<VertexDeclarati
m_shader(shader),
m_vdecl(vdecl)
{
Ticker::Ref(m_shader.get());
}

SubMesh::~SubMesh()
{
Ticker::Unref(m_shader.get());
// TODO: cleanup
}

void SubMesh::SetMeshPrimitive(MeshPrimitive mesh_primitive)
@@ -77,9 +74,7 @@ void SubMesh::SetMeshPrimitive(MeshPrimitive mesh_primitive)

void SubMesh::SetShader(std::shared_ptr<Shader> shader)
{
Ticker::Unref(m_shader.get());
m_shader = shader;
Ticker::Ref(m_shader.get());
}

std::shared_ptr<Shader> SubMesh::GetShader()


Cargando…
Cancelar
Guardar