[Mesa-dev] [PATCH] i965: remove dead code path in brw_tcs_precompile()

Timothy Arceri timothy.arceri at collabora.com
Sat Nov 19 23:41:33 UTC 2016


On Sun, 2016-11-20 at 09:40 +1100, Timothy Arceri wrote:
> The glsl linker will have already failed if we tried linking a tcs
> without a tes.

Actually this used by SSO. Please ignore.

> ---
>  src/mesa/drivers/dri/i965/brw_tcs.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c
> b/src/mesa/drivers/dri/i965/brw_tcs.c
> index ec3f3cb..7e1a65f 100644
> --- a/src/mesa/drivers/dri/i965/brw_tcs.c
> +++ b/src/mesa/drivers/dri/i965/brw_tcs.c
> @@ -398,6 +398,7 @@ brw_tcs_precompile(struct gl_context *ctx,
>     struct brw_program *btcp = brw_program(prog);
>     const struct gl_linked_shader *tes =
>        shader_prog->_LinkedShaders[MESA_SHADER_TESS_EVAL];
> +   assert(tes);
>  
>     memset(&key, 0, sizeof(key));
>  
> @@ -410,14 +411,10 @@ brw_tcs_precompile(struct gl_context *ctx,
>           _LinkedShaders[MESA_SHADER_TESS_CTRL]-
> >info.TessCtrl.VerticesOut;
>     }
>  
> -   if (tes) {
> -      key.tes_primitive_mode = tes->info.TessEval.PrimitiveMode;
> -      key.quads_workaround = brw->gen < 9 &&
> -                             tes->info.TessEval.PrimitiveMode ==
> GL_QUADS &&
> -                             tes->info.TessEval.Spacing == GL_EQUAL;
> -   } else {
> -      key.tes_primitive_mode = GL_TRIANGLES;
> -   }
> +   key.tes_primitive_mode = tes->info.TessEval.PrimitiveMode;
> +   key.quads_workaround = brw->gen < 9 &&
> +                          tes->info.TessEval.PrimitiveMode ==
> GL_QUADS &&
> +                          tes->info.TessEval.Spacing == GL_EQUAL;
>  
>     key.outputs_written = prog->nir->info->outputs_written;
>     key.patch_outputs_written = prog->nir->info-
> >patch_outputs_written;


More information about the mesa-dev mailing list