X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=src%2Fvoglcommon%2Fvogl_gl_replayer.cpp;h=2a91fe2cf2eae7efea643bc677c82853fca6b632;hb=f847877de64279caf7e91b135de62a454bd576dc;hp=f11a954f30cea9a8d81bd1d7f680dfac1ee66f91;hpb=d73de670dade59a783990e5ac264bb3cfd9d45d9;p=vogl diff --git a/src/voglcommon/vogl_gl_replayer.cpp b/src/voglcommon/vogl_gl_replayer.cpp index f11a954..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()) @@ -4008,7 +4011,8 @@ vogl_gl_replayer::status_t vogl_gl_replayer::process_gl_entrypoint_packet_intern // (typically pointers to fixed size buffers, or params directly controlling the size of buffers). #define VOGL_SIMPLE_REPLAY_FUNC_BEGIN(name, num_params) \ case VOGL_ENTRYPOINT_##name: \ - { GL_ENTRYPOINT(name)( + { if (!GL_ENTRYPOINT(name)) { process_entrypoint_error("vogl_gl_replayer::process_gl_entrypoint_packet_internal: Can't call NULL GL entrypoint %s (maybe a missing extension?)\n", #name); } else \ + GL_ENTRYPOINT(name)( #define VOGL_SIMPLE_REPLAY_FUNC_PARAM_VALUE(type, index) trace_packet.get_param_value(index) #define VOGL_SIMPLE_REPLAY_FUNC_PARAM_SEPERATOR , #define VOGL_SIMPLE_REPLAY_FUNC_PARAM_CLIENT_MEMORY(type, index) trace_packet.get_param_client_memory(index)