From 1ee1d50b0a739ba9fa7e38cae46824344971fddf Mon Sep 17 00:00:00 2001 From: Nicolas Guillemot Date: Sat, 10 Sep 2016 18:12:14 -0700 Subject: [PATCH] handle NULL textures array in glBindImageTextures ported the fix from glBindTextures --- renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp index 80ff5bf49..6dfb6d403 100644 --- a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp @@ -557,7 +557,10 @@ bool WrappedOpenGL::Serialise_glBindImageTextures(GLuint first, GLsizei count, c for(int32_t i = 0; i < Count; i++) { - SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(TextureRes(GetCtx(), textures[i]))); + SERIALISE_ELEMENT(ResourceId, id, + textures && textures[i] + ? GetResourceManager()->GetID(TextureRes(GetCtx(), textures[i])) + : ResourceId()); if(m_State <= EXECUTING) { @@ -596,7 +599,7 @@ void WrappedOpenGL::glBindImageTextures(GLuint first, GLsizei count, const GLuin m_ContextRecord->AddChunk(scope.Get()); for(GLsizei i = 0; i < count; i++) - if(textures[i]) + if(textures != NULL && textures[i] != 0) GetResourceManager()->MarkResourceFrameReferenced(TextureRes(GetCtx(), textures[i]), eFrameRef_Read); }