From f8de09a811fc1f5b8733e1a36bafd55c778139be Mon Sep 17 00:00:00 2001 From: Patrick Lerda Date: Mon, 10 Nov 2025 12:56:26 +0100 Subject: [PATCH] r600: fix rv770 read scratch compatibility The flag mega_fetch should be set on rv770 for a read scratch operation (as written in the r700 documentation p357). Without this flag, read scratch does not work and a gpu hang could be triggered. Here are the tests fixed: shaders/glsl-predication-on-large-array: fail pass spec/glsl-1.10/execution/temp-array-indexing/glsl-fs-giant-temp-array: fail pass spec/glsl-1.10/execution/temp-array-indexing/glsl-vs-giant-temp-array: fail pass spec/glsl-1.30/execution/fs-large-local-array: fail pass spec/glsl-1.30/execution/fs-large-local-array-vec2: fail pass spec/glsl-1.30/execution/fs-large-local-array-vec3: fail pass spec/glsl-1.30/execution/fs-large-local-array-vec4: fail pass spec/glsl-1.30/execution/fs-multiple-large-local-arrays: fail pass Fixes: 9c48a139b08f ("r600g: Support emitting scratch ops") Signed-off-by: Patrick Lerda Part-of: --- src/gallium/drivers/r600/ci/r600-rv770-flakes.txt | 1 - src/gallium/drivers/r600/ci/r600-rv770-skips.txt | 1 - src/gallium/drivers/r600/r700_asm.c | 4 +++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/ci/r600-rv770-flakes.txt b/src/gallium/drivers/r600/ci/r600-rv770-flakes.txt index 5a891237e13..57403ae3f2b 100644 --- a/src/gallium/drivers/r600/ci/r600-rv770-flakes.txt +++ b/src/gallium/drivers/r600/ci/r600-rv770-flakes.txt @@ -1,4 +1,3 @@ spec@!opengl 3.2@gl-3.2-adj-prims pv-last spec@!opengl 3.2@layered-rendering@gl-layer-render-clipped spec@arb_fragment_layer_viewport@viewport-gs-write-simple -spec@glsl-1.30@execution@fs-large-local-array-vec4 diff --git a/src/gallium/drivers/r600/ci/r600-rv770-skips.txt b/src/gallium/drivers/r600/ci/r600-rv770-skips.txt index 8ec2d1bc478..5b1e15eff77 100644 --- a/src/gallium/drivers/r600/ci/r600-rv770-skips.txt +++ b/src/gallium/drivers/r600/ci/r600-rv770-skips.txt @@ -7,7 +7,6 @@ texelfetch@gs # GPU hangs now variable-indexing@gs-in -fs-multiple-large-local-arrays # intermittent GL_OOMs, let's make sure that doesn't impact other tests. spec@!opengl 1.2@tex3d-maxsize diff --git a/src/gallium/drivers/r600/r700_asm.c b/src/gallium/drivers/r600/r700_asm.c index 0b1b9f00a0b..11e4538b2ba 100644 --- a/src/gallium/drivers/r600/r700_asm.c +++ b/src/gallium/drivers/r600/r700_asm.c @@ -139,7 +139,9 @@ int r700_bytecode_fetch_mem_build(struct r600_bytecode *bc, struct r600_bytecode bc->bytecode[id++] = S_SQ_MEM_RD_WORD2_ARRAY_BASE(mem->array_base) | S_SQ_MEM_RD_WORD2_ENDIAN_SWAP(0) | - S_SQ_MEM_RD_WORD2_ARRAY_SIZE(mem->array_size); + S_SQ_MEM_RD_WORD2_ARRAY_SIZE(mem->array_size) | + (bc->gfx_level == R700 && opcode == 0 ? + S_SQ_VTX_WORD2_MEGA_FETCH(1) : 0); bc->bytecode[id++] = 0; /* MEM ops are 4 word aligned */