diff options
author | Timothy Arceri <[email protected]> | 2016-11-20 21:44:29 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-01-23 14:48:04 +1100 |
commit | f86d15ed94df59e4b3cdb4099d69cdd81f52fc27 (patch) | |
tree | 5d6f13c0b405bb2ee1e79b6ed6142794cd4a6af4 /src/compiler/glsl/linker.cpp | |
parent | c505d6d852220f4aaaee161465dd2c579647e672 (diff) |
st/mesa/glsl: change xfb_program field to last_vert_prog
Now that the i965 backend doesn't depend on this field we can
make it more generic and short circuit a bunch of code paths.
The new field will be used in a following patch for another
clean-up.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index fb26be48950..846f77f4c7d 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4235,27 +4235,29 @@ build_program_resource_list(struct gl_context *ctx, output_stage, GL_PROGRAM_OUTPUT)) return; - struct gl_transform_feedback_info *linked_xfb = - shProg->xfb_program->sh.LinkedTransformFeedback; - - /* Add transform feedback varyings. */ - if (linked_xfb->NumVarying > 0) { - for (int i = 0; i < linked_xfb->NumVarying; i++) { - if (!add_program_resource(shProg, resource_set, - GL_TRANSFORM_FEEDBACK_VARYING, - &linked_xfb->Varyings[i], 0)) - return; + if (shProg->last_vert_prog) { + struct gl_transform_feedback_info *linked_xfb = + shProg->last_vert_prog->sh.LinkedTransformFeedback; + + /* Add transform feedback varyings. */ + if (linked_xfb->NumVarying > 0) { + for (int i = 0; i < linked_xfb->NumVarying; i++) { + if (!add_program_resource(shProg, resource_set, + GL_TRANSFORM_FEEDBACK_VARYING, + &linked_xfb->Varyings[i], 0)) + return; + } } - } - /* Add transform feedback buffers. */ - for (unsigned i = 0; i < ctx->Const.MaxTransformFeedbackBuffers; i++) { - if ((linked_xfb->ActiveBuffers >> i) & 1) { - linked_xfb->Buffers[i].Binding = i; - if (!add_program_resource(shProg, resource_set, - GL_TRANSFORM_FEEDBACK_BUFFER, - &linked_xfb->Buffers[i], 0)) - return; + /* Add transform feedback buffers. */ + for (unsigned i = 0; i < ctx->Const.MaxTransformFeedbackBuffers; i++) { + if ((linked_xfb->ActiveBuffers >> i) & 1) { + linked_xfb->Buffers[i].Binding = i; + if (!add_program_resource(shProg, resource_set, + GL_TRANSFORM_FEEDBACK_BUFFER, + &linked_xfb->Buffers[i], 0)) + return; + } } } @@ -4566,15 +4568,12 @@ link_varyings_and_uniforms(unsigned first, unsigned last, return false; } - /* Find the program used for xfb. Even if we don't use xfb we still want to - * set this so we can fill the default values for program interface query. - */ - prog->xfb_program = prog->_LinkedShaders[last]->Program; + prog->last_vert_prog = NULL; for (int i = MESA_SHADER_GEOMETRY; i >= MESA_SHADER_VERTEX; i--) { if (prog->_LinkedShaders[i] == NULL) continue; - prog->xfb_program = prog->_LinkedShaders[i]->Program; + prog->last_vert_prog = prog->_LinkedShaders[i]->Program; break; } |