r300: fix vs output register indexing

Vertex shaders were writing TEXCOORDs before GENERICS, however
fragment shaders were reading it the opposite way, so this caused
problems for shaders that used both TEXCOORD and GENERIC varyings.

Fixes: d4b8e8a481
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10489
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip.gawin@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27469>
(cherry picked from commit 0ac6801970f88402f4f98455652448bc5ca97096)
This commit is contained in:
Pavel Ondračka 2024-02-07 16:12:54 +01:00 committed by Eric Engestrom
parent 7d78a9b36b
commit feacc7e5a3
3 changed files with 8 additions and 9 deletions

View file

@ -2844,7 +2844,7 @@
"description": "r300: fix vs output register indexing", "description": "r300: fix vs output register indexing",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": "d4b8e8a48144f4b899d48c271558f0dc613632cb", "because_sha": "d4b8e8a48144f4b899d48c271558f0dc613632cb",
"notes": null "notes": null

View file

@ -368,7 +368,6 @@ shaders@glsl-bug-110796,Fail
shaders@glsl-fs-bug25902,Fail shaders@glsl-fs-bug25902,Fail
shaders@glsl-fwidth,Fail shaders@glsl-fwidth,Fail
shaders@glsl-lod-bias,Fail shaders@glsl-lod-bias,Fail
shaders@glsl-orangebook-ch06-bump,Fail
shaders@glsl-uniform-interstage-limits@subdivide 5,Fail shaders@glsl-uniform-interstage-limits@subdivide 5,Fail
shaders@glsl-uniform-interstage-limits@subdivide 5- statechanges,Fail shaders@glsl-uniform-interstage-limits@subdivide 5- statechanges,Fail

View file

@ -158,13 +158,6 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
} }
} }
/* Texture coordinates. */
for (i = 0; i < ATTR_TEXCOORD_COUNT; i++) {
if (outputs->texcoord[i] != ATTR_UNUSED) {
c->code->outputs[outputs->texcoord[i]] = reg++;
}
}
/* Generics. */ /* Generics. */
for (i = 0; i < ATTR_GENERIC_COUNT; i++) { for (i = 0; i < ATTR_GENERIC_COUNT; i++) {
if (outputs->generic[i] != ATTR_UNUSED) { if (outputs->generic[i] != ATTR_UNUSED) {
@ -172,6 +165,13 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c)
} }
} }
/* Texture coordinates. */
for (i = 0; i < ATTR_TEXCOORD_COUNT; i++) {
if (outputs->texcoord[i] != ATTR_UNUSED) {
c->code->outputs[outputs->texcoord[i]] = reg++;
}
}
/* Fog coordinates. */ /* Fog coordinates. */
if (outputs->fog != ATTR_UNUSED) { if (outputs->fog != ATTR_UNUSED) {
c->code->outputs[outputs->fog] = reg++; c->code->outputs[outputs->fog] = reg++;