From: Rich Geldreich Date: Wed, 19 Mar 2014 21:41:19 +0000 (-0700) Subject: - Fixing driver crash on AMD's fglrx caused by us passing down possibly bogus handles... X-Git-Url: https://git.cworth.org/git?p=vogl;a=commitdiff_plain;h=f847877de64279caf7e91b135de62a454bd576dc - Fixing driver crash on AMD's fglrx caused by us passing down possibly bogus handles when we fail to remote program uniform's (which commonly happens when we trace on NVidia and try to replay on AMD, which more aggressively optimizes uniforms). --- diff --git a/src/voglcommon/vogl_gl_replayer.cpp b/src/voglcommon/vogl_gl_replayer.cpp index 0df3d49..2a91fe2 100644 --- a/src/voglcommon/vogl_gl_replayer.cpp +++ b/src/voglcommon/vogl_gl_replayer.cpp @@ -1266,7 +1266,10 @@ GLint vogl_gl_replayer::determine_uniform_replay_location(GLuint trace_program, { VOGL_FUNC_TRACER - GLint replay_location = trace_location; + // Seems better to return -1 when we can't find the uniform (which can happen if the driver optimizes the program differently vs. tracing). + // Otherwise, we can pass an invalid handle down to the driver and this will crash AMD's fglrx. + //GLint replay_location = trace_location; + GLint replay_location = -1; glsl_program_hash_map::iterator it = get_shared_state()->m_glsl_program_hash_map.find(trace_program); if (it == get_shared_state()->m_glsl_program_hash_map.end())