From 0ac6801970f88402f4f98455652448bc5ca97096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Wed, 7 Feb 2024 16:12:54 +0100 Subject: [PATCH] r300: fix vs output register indexing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: d4b8e8a48144f4b899d48c271558f0dc613632cb Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10489 Signed-off-by: Pavel Ondračka Reviewed-by: Filip Gawin Part-of: --- .../drivers/r300/ci/r300-rv530-nohiz-fails.txt | 1 - src/gallium/drivers/r300/r300_vs.c | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt b/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt index 47168518863..887ce0eafdb 100644 --- a/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt +++ b/src/gallium/drivers/r300/ci/r300-rv530-nohiz-fails.txt @@ -366,7 +366,6 @@ KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_nearest,Fail shaders@glsl-arb-fragment-coord-conventions,Fail shaders@glsl-bug-110796,Fail shaders@glsl-fwidth,Fail -shaders@glsl-orangebook-ch06-bump,Fail shaders@glsl-uniform-interstage-limits@subdivide 5,Fail shaders@glsl-uniform-interstage-limits@subdivide 5- statechanges,Fail diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index bb34259d96d..2d68c1fee3b 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -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. */ for (i = 0; i < ATTR_GENERIC_COUNT; i++) { 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. */ if (outputs->fog != ATTR_UNUSED) { c->code->outputs[outputs->fog] = reg++;