summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Janes <mark.a.janes@intel.com>2017-05-30 17:11:26 -0700
committerMark Janes <mark.a.janes@intel.com>2017-06-19 14:11:07 -0700
commit0e4bba0029372bc44d75e63d21ed9966300781d4 (patch)
tree0acd78cc68365f508ed68685c68e37f50f8d3052
parent6256a126c62a900f7f4c8bd2c2d8ac34b3f47f3f (diff)
StateTrack: report shaders for SSO pipelines
-rw-r--r--retrace/daemon/glframe_state.cpp63
1 files changed, 57 insertions, 6 deletions
diff --git a/retrace/daemon/glframe_state.cpp b/retrace/daemon/glframe_state.cpp
index f8f56a4e..93d5c5b9 100644
--- a/retrace/daemon/glframe_state.cpp
+++ b/retrace/daemon/glframe_state.cpp
@@ -267,38 +267,86 @@ StateTrack::parse() {
const ShaderAssembly &
StateTrack::currentVertexShader() const {
- auto sh = program_to_vertex.find(current_program);
+ int program = current_program;
+ if (current_program == 0 && current_pipeline != 0) {
+ auto pipe = pipeline_to_vertex_program.find(current_pipeline);
+ if (pipe == pipeline_to_vertex_program.end())
+ program = 0;
+ else
+ program = pipe->second;
+ }
+ auto sh = program_to_vertex.find(program);
return (sh == program_to_vertex.end() ?
empty_shader : sh->second);
}
const ShaderAssembly &
StateTrack::currentFragmentShader() const {
- auto sh = program_to_fragment.find(current_program);
+ int program = current_program;
+ if (current_program == 0 && current_pipeline != 0) {
+ auto pipe = pipeline_to_fragment_program.find(current_pipeline);
+ if (pipe == pipeline_to_fragment_program.end())
+ program = 0;
+ else
+ program = pipe->second;
+ }
+ auto sh = program_to_fragment.find(program);
return (sh == program_to_fragment.end() ? empty_shader : sh->second);
}
const ShaderAssembly &
StateTrack::currentTessControlShader() const {
- auto sh = program_to_tess_control.find(current_program);
+ int program = current_program;
+ if (current_program == 0 && current_pipeline != 0) {
+ auto pipe = pipeline_to_tess_control_program.find(current_pipeline);
+ if (pipe == pipeline_to_tess_control_program.end())
+ program = 0;
+ else
+ program = pipe->second;
+ }
+ auto sh = program_to_tess_control.find(program);
return (sh == program_to_tess_control.end() ? empty_shader : sh->second);
}
const ShaderAssembly &
StateTrack::currentTessEvalShader() const {
- auto sh = program_to_tess_eval.find(current_program);
+ int program = current_program;
+ if (current_program == 0 && current_pipeline != 0) {
+ auto pipe = pipeline_to_tess_eval_program.find(current_pipeline);
+ if (pipe == pipeline_to_tess_eval_program.end())
+ program = 0;
+ else
+ program = pipe->second;
+ }
+ auto sh = program_to_tess_eval.find(program);
return (sh == program_to_tess_eval.end() ? empty_shader : sh->second);
}
const ShaderAssembly &
StateTrack::currentGeomShader() const {
- auto sh = program_to_geom.find(current_program);
+ int program = current_program;
+ if (current_program == 0 && current_pipeline != 0) {
+ auto pipe = pipeline_to_geom_program.find(current_pipeline);
+ if (pipe == pipeline_to_geom_program.end())
+ program = 0;
+ else
+ program = pipe->second;
+ }
+ auto sh = program_to_geom.find(program);
return (sh == program_to_geom.end() ? empty_shader : sh->second);
}
const ShaderAssembly &
StateTrack::currentCompShader() const {
- auto sh = program_to_comp.find(current_program);
+ int program = current_program;
+ if (current_program == 0 && current_pipeline != 0) {
+ auto pipe = pipeline_to_comp_program.find(current_pipeline);
+ if (pipe == pipeline_to_comp_program.end())
+ program = 0;
+ else
+ program = pipe->second;
+ }
+ auto sh = program_to_comp.find(program);
return (sh == program_to_comp.end() ? empty_shader : sh->second);
}
@@ -358,6 +406,9 @@ StateTrack::useProgram(int orig_retraced_program,
if (vs.empty() && comp.empty())
return -1;
+ if (orig_retraced_program == 0)
+ return -1;
+
const ProgramKey k(orig_retraced_program,
vs, fs, tessControl, tessEval,
geom, comp);