mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Handle glCreateShaderProgramv returning 0 if the call fails
* The majority of GL calls that create objects are pretty failure proof since they don't really do anything apart from create/allocate. In the case of glCreateShaderProgramv though it requires the call to be valid e.g. the type enum to be correct, so it can actually return 0 if that happens. * If we don't check for this then we end up creating an ID and program for name 0 which causes all sorts of problems.
This commit is contained in:
@@ -470,6 +470,9 @@ GLuint WrappedOpenGL::glCreateShaderProgramv(GLenum type, GLsizei count, const G
|
||||
{
|
||||
GLuint real = m_Real.glCreateShaderProgramv(type, count, strings);
|
||||
|
||||
if(real == 0)
|
||||
return real;
|
||||
|
||||
GLResource res = ProgramRes(GetCtx(), real);
|
||||
ResourceId id = GetResourceManager()->RegisterResource(res);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user