[Mesa-dev] [PATCH 04/15] mesa/glspirv: Set last_vert_prog
Timothy Arceri
tarceri at itsqueeze.com
Sat Jul 28 01:32:04 UTC 2018
On 21/07/18 01:08, Alejandro PiƱeiro wrote:
> From: Neil Roberts <nroberts at igalia.com>
>
> ---
> src/mesa/main/glspirv.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c
> index 8ad6c373914..ba4a8253671 100644
> --- a/src/mesa/main/glspirv.c
> +++ b/src/mesa/main/glspirv.c
> @@ -173,6 +173,13 @@ _mesa_spirv_link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
> prog->_LinkedShaders[shader_type] = linked;
> prog->data->linked_stages |= 1 << shader_type;
> }
> +
> + int last_vert_stage =
> + util_last_bit(prog->data->linked_stages &
> + (((1 << (MESA_SHADER_GEOMETRY + 1)) - 1) ^
> + ((1 << MESA_SHADER_VERTEX) - 1)));
Isn't this the same as:
int last_vert_stage =
util_last_bit(prog->data->linked_stages &
((1 << (MESA_SHADER_GEOMETRY + 1)) - 1));
As ((1 << MESA_SHADER_VERTEX) - 1)) == 0
If you use the above simplification this patch is:
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
> + if (last_vert_stage)
> + prog->last_vert_prog = prog->_LinkedShaders[last_vert_stage - 1]->Program;
> }
>
> nir_shader *
>
More information about the mesa-dev
mailing list