[Mesa-dev] [PATCH 10/10] i965/nir: Use the nir copy of shader_info to handle gl_PatchVerticesIn

Timothy Arceri tarceri at itsqueeze.com
Mon Aug 13 02:46:25 UTC 2018


6-10:

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 09/08/18 23:43, Alejandro Piñeiro wrote:
> From: Neil Roberts <nroberts at igalia.com>
> 
> Instead of using the copy of shader_info stored in gl_program, it now
> uses the one in nir_shader. This is needed for SPIR-V because the
> info.tess.tcs_vertices_out is filled in via _mesa_spirv_to_nir which
> happens much later than with a GLSL shader. The copy of shader_data in
> gl_program is only updated later via brw_shader_gather_info but that
> is too late.
> 
> For GLSL this shouldn't create any problems because the nir copy of
> the shader_info is immediately copied from the gl_program in
> glsl_to_nir.
> 
> v2: updated after commit "i965: Combine both gl_PatchVerticesIn
>      lowering passes." (488972) (Alejandro Piñeiro)
> ---
>   src/mesa/drivers/dri/i965/brw_program.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
> index 7adb75d0eaa..a669814d0d2 100644
> --- a/src/mesa/drivers/dri/i965/brw_program.c
> +++ b/src/mesa/drivers/dri/i965/brw_program.c
> @@ -116,7 +116,7 @@ brw_create_nir(struct brw_context *brw,
>         struct gl_linked_shader *tcs =
>            shader_prog->_LinkedShaders[MESA_SHADER_TESS_CTRL];
>         uint32_t static_patch_vertices =
> -         tcs ? tcs->Program->info.tess.tcs_vertices_out : 0;
> +         tcs ? tcs->Program->nir->info.tess.tcs_vertices_out : 0;
>         static const gl_state_index16 tokens[STATE_LENGTH] =
>            { STATE_INTERNAL, STATE_TES_PATCH_VERTICES_IN };
>         nir_lower_patch_vertices(nir, static_patch_vertices, tokens);
> 


More information about the mesa-dev mailing list