[Mesa-dev] [PATCH] tgsi/exec: fix system value handling.
Brian Paul
brianp at vmware.com
Tue Apr 26 15:21:51 UTC 2016
On 04/25/2016 09:06 PM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> a) SysSemanticToIndex needs to be indexed with the semantic name
> not the decl->Declaration.Semantic.
>
> b) doing this in run is too late, as the mappings are all setup
> prior to run in the execs.
>
> This fixes
> point-vertex-id gl_vertex_id gl_instanceid
> point-vertex-id gl_vertex_id gl_instanceid divisor
> piglits.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/gallium/auxiliary/tgsi/tgsi_exec.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
> index 4567a94..516e675 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
> @@ -964,6 +964,11 @@ tgsi_exec_machine_bind_shader(
> ++mach->NumOutputs;
> }
> }
> + if (parse.FullToken.FullDeclaration.Declaration.File == TGSI_FILE_SYSTEM_VALUE) {
I think that could be an "else if".
> + const struct tgsi_full_declaration *decl = &parse.FullToken.FullDeclaration;
> + mach->SysSemanticToIndex[decl->Semantic.Name] = decl->Range.First;
> + }
> +
> memcpy(declarations + numDeclarations,
> &parse.FullToken.FullDeclaration,
> sizeof(declarations[0]));
> @@ -2777,9 +2782,6 @@ exec_declaration(struct tgsi_exec_machine *mach,
> }
> }
>
> - if (decl->Declaration.File == TGSI_FILE_SYSTEM_VALUE) {
> - mach->SysSemanticToIndex[decl->Declaration.Semantic] = decl->Range.First;
> - }
> }
>
> typedef void (* micro_unary_op)(union tgsi_exec_channel *dst,
>
Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list