summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2020-08-25 16:01:47 -0700
committerEric Anholt <eric@anholt.net>2020-09-02 09:59:17 -0700
commit329dee14555b8c8da59e6b47a51050f2aa736596 (patch)
tree73a05d69f0a607b3d46e3557c4e3486d7529bc8a /src/gallium
parented745febe1c05352459869e4f67bdf6e1d2a1d0c (diff)
gallium/tgsi_exec: Fix up NumOutputs counting
We can get duplicate declarations for an index (for example dvec3 + float packed into 2 vec4s, the second one won't pack into the first's array decl), and we'd end up stepping by the wrong amount in GS vtx/prim emit. Fixes vs-gs-fs-double, sso-vs-gs-fs-array-interleave piglit tests. Fixes: 49155c3264d0 ("draw/tgsi: fix geometry shader input/output swizzling") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6567>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 83f0b1b0134..ab17c1f9bc2 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -1191,14 +1191,8 @@ tgsi_exec_machine_bind_shader(
* sizeof(struct tgsi_full_declaration));
maxDeclarations += 10;
}
- if (parse.FullToken.FullDeclaration.Declaration.File == TGSI_FILE_OUTPUT) {
- unsigned reg;
- for (reg = parse.FullToken.FullDeclaration.Range.First;
- reg <= parse.FullToken.FullDeclaration.Range.Last;
- ++reg) {
- ++mach->NumOutputs;
- }
- }
+ if (parse.FullToken.FullDeclaration.Declaration.File == TGSI_FILE_OUTPUT)
+ mach->NumOutputs = MAX2(mach->NumOutputs, parse.FullToken.FullDeclaration.Range.Last + 1);
else if (parse.FullToken.FullDeclaration.Declaration.File == TGSI_FILE_SYSTEM_VALUE) {
const struct tgsi_full_declaration *decl = &parse.FullToken.FullDeclaration;
mach->SysSemanticToIndex[decl->Semantic.Name] = decl->Range.First;