diff options
author | Timothy Arceri <[email protected]> | 2016-06-22 12:41:27 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-06-23 11:01:36 +1000 |
commit | 24b3be093870a9a77325ac33c8fce97fae143e8e (patch) | |
tree | 6686078dd64c5b63512cb875c7c593d7215c8eb8 /src/mesa/main/api_validate.c | |
parent | f3ae370a36c2103ce994865f5c3713377a9d0ae9 (diff) |
glsl/mesa: stop duplicating tes layout values
We already store this in gl_shader and gl_program here we
remove it from gl_shader_program and just use the values
from gl_shader.
This will allow us to keep the shader cache restore code as
simple as it can be while making it somewhat clearer where these
values originate from.
V2: remove unnecessary NULL check
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Iago Toral <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r-- | src/mesa/main/api_validate.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 4ef86b89ea5..ab34d99834c 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -206,9 +206,10 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name) GLenum mode_before_gs = mode; if (tes) { - if (tes->TessEval.PointMode) + struct gl_shader *tes_sh = tes->_LinkedShaders[MESA_SHADER_TESS_EVAL]; + if (tes_sh->TessEval.PointMode) mode_before_gs = GL_POINTS; - else if (tes->TessEval.PrimitiveMode == GL_ISOLINES) + else if (tes_sh->TessEval.PrimitiveMode == GL_ISOLINES) mode_before_gs = GL_LINES; else /* the GL_QUADS mode generates triangles too */ @@ -321,10 +322,10 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name) else if (ctx->_Shader->CurrentProgram[MESA_SHADER_TESS_EVAL]) { struct gl_shader_program *tes = ctx->_Shader->CurrentProgram[MESA_SHADER_TESS_EVAL]; - - if (tes->TessEval.PointMode) + struct gl_shader *tes_sh = tes->_LinkedShaders[MESA_SHADER_TESS_EVAL]; + if (tes_sh->TessEval.PointMode) pass = ctx->TransformFeedback.Mode == GL_POINTS; - else if (tes->TessEval.PrimitiveMode == GL_ISOLINES) + else if (tes_sh->TessEval.PrimitiveMode == GL_ISOLINES) pass = ctx->TransformFeedback.Mode == GL_LINES; else pass = ctx->TransformFeedback.Mode == GL_TRIANGLES; |