diff options
author | Mark Janes <mark.a.janes@intel.com> | 2017-03-21 10:05:16 -0700 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2017-06-19 14:04:51 -0700 |
commit | 0bc38f6d2177ce912214665bfeed1cd9208a5e79 (patch) | |
tree | f4b82be4a2c43ab3b1ae8652d05b0032d068a23b /retrace | |
parent | 43da6fe13685ca075d7fc224be3881db1cb8896f (diff) |
Uniforms: Initialize uniform data for new programs
BorderLands2 failed to retrace modified programs, due to mishandled
uniform constant data that was partially initialized at link time.
Diffstat (limited to 'retrace')
-rw-r--r-- | retrace/daemon/glframe_state.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/retrace/daemon/glframe_state.cpp b/retrace/daemon/glframe_state.cpp index a8e5d8d2..dbc57d69 100644 --- a/retrace/daemon/glframe_state.cpp +++ b/retrace/daemon/glframe_state.cpp @@ -38,6 +38,7 @@ #include "glframe_glhelper.hpp" #include "glframe_logger.hpp" #include "glframe_retrace_interface.hpp" +#include "glframe_uniforms.hpp" #include "glretrace.hpp" #include "retrace.hpp" #include "trace_model.hpp" @@ -49,6 +50,7 @@ using glretrace::OnFrameRetrace; using glretrace::ShaderAssembly; using glretrace::ShaderType; using glretrace::AssemblyType; +using glretrace::Uniforms; using trace::Call; using trace::Array; @@ -610,6 +612,16 @@ StateTrack::useProgram(int orig_retraced_program, binding); } + // set initial uniform state for program, based on the original. + // Some game titles partially initialize uniforms at link time. + int cur_prog; + GlFunctions::GetIntegerv(GL_CURRENT_PROGRAM, &cur_prog); + GlFunctions::UseProgram(orig_retraced_program); + Uniforms orig; + GlFunctions::UseProgram(pid); + orig.set(); + GlFunctions::UseProgram(cur_prog); + return pid; } |