mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-09-30 13:19:06 +00:00
gl: Avoid calling gl functions without a context even if the object is GL_NONE
- While calling glDestroyXXXX with GL_NONE is a no-op, calling it without a context will crash some drivers.
This commit is contained in:
parent
98b6783c05
commit
954c60947d
1 changed files with 6 additions and 6 deletions
|
@ -35,16 +35,16 @@ namespace gl
|
||||||
|
|
||||||
~shader()
|
~shader()
|
||||||
{
|
{
|
||||||
if (created())
|
remove();
|
||||||
{
|
|
||||||
remove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove()
|
void remove()
|
||||||
{
|
{
|
||||||
glDeleteShader(m_id);
|
if (m_id)
|
||||||
m_id = GL_NONE;
|
{
|
||||||
|
glDeleteShader(m_id);
|
||||||
|
m_id = GL_NONE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void create(::glsl::program_domain type_, const std::string& src);
|
void create(::glsl::program_domain type_, const std::string& src);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue