mesa/src/gallium/drivers
Patrick Lerda 161f3c2144 r600: make vertex r10g10b10a2_sscaled conformant on palm and beyond
This is a gl4.3 issue very similar to e8fa3b4950.

The mode r10g10b10a2_sscaled processed as vertex on palm at the
hardware level doesn't follow the current standard. Indeed, the .w
component (2-bits) is not calculated as expected. The table below
describes the situation.

This change fixes this issue by adding two gpu instructions at
the vertex fetch shader stage. An equivalent C representation and
a gpu asm dump of the generated sequence are available below.

.w(2-bits)	expected	palm		cypress
0		 0		0		 0
1		 1		1		 1
2		-2		2		-2
3		-1		3		-1

w_out = w_in - (w_in > 1. ? 4. : 0.);

0002 00000024 A0040000  ALU 2 @72
 0072 801F2C0A 600004C0     1 w:     SETGT*4                __.w,  R10.w, 1.0
 0074 839FCC0A 61400010     2 w:     ADD                    R10.w,  R10.w, -PV.w

Note: cypress returns the expected value, and does not need
this correction.

This change was tested on palm, barts and cayman. Here are the tests fixed:
khr-gl4[3-6]/vertex_attrib_binding/basic-input-case6: fail pass
khr-gles31/core/vertex_attrib_binding/basic-input-case6: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38849>
(cherry picked from commit 2ed761021f)
2026-01-28 16:17:58 +01:00
..
asahi ALL: use #define and a copy helper to check and copy build_id 2026-01-07 08:32:33 +00:00
crocus ALL: use #define and a copy helper to check and copy build_id 2026-01-07 08:32:33 +00:00
d3d12 d3d12: Add HAVE_GALLIUM_D3D12_VIDEO guards for d3d12_video_encoder_set_max_async_queue_depth/d3d12_video_encoder_get_last_slice_completion_fence 2026-01-28 16:17:58 +01:00
ethosu ethos: fix build on non LP64 architectures 2025-12-23 08:58:26 +00:00
etnaviv etnaviv: simplify constant dirty bit handling during state emission 2026-01-21 15:42:45 +00:00
freedreno freedreno: Force single wavesize if double threadsize is unsupported 2026-01-28 16:17:58 +01:00
i915 gallium: change pipe_framebuffer_state width/height to 32-bit integer 2025-12-05 21:22:36 +00:00
iris iris: fix incorrect intrinsic usage on ELK 2026-01-28 16:17:58 +01:00
lima lavapipe,nv50/ir,lima: run nir_opt_algebraic_late 2026-01-19 16:11:28 +00:00
llvmpipe llvmpipe: advertise support for subgroups in all stages 2026-01-09 21:53:28 +00:00
nouveau lavapipe,nv50/ir,lima: run nir_opt_algebraic_late 2026-01-19 16:11:28 +00:00
panfrost panfrost: SPDX everything 2026-01-20 20:49:33 +00:00
r300 nir: add nir_alu_instr_is_exact helper 2026-01-07 09:40:57 +00:00
r600 r600: make vertex r10g10b10a2_sscaled conformant on palm and beyond 2026-01-28 16:17:58 +01:00
radeonsi radeonsi: Remove previous mitigation of CS regalloc hang bug 2026-01-21 17:24:57 +00:00
rocket rocket: fix building for musl 2026-01-10 16:01:55 +00:00
softpipe Uprev Piglit to 2842979ebe03b99c33c3e49af5960c69be6c6d46 2025-12-12 21:45:24 +00:00
svga Uprev Piglit to 62d499d63d2b8b29a67efd9d93ed9b6a94d4950e 2026-01-14 06:57:19 +00:00
tegra gallium: add pipe_context::resource_release to eliminate buffer refcounting 2025-09-09 20:47:38 +00:00
v3d ALL: use #define and a copy helper to check and copy build_id 2026-01-07 08:32:33 +00:00
vc4 nir/uub: Use an optional max_samples from drivers for sample counts. 2025-12-11 14:26:11 +00:00
virgl util: Fix HAVE_BUILD_ID ifdefs 2026-01-15 06:12:05 +00:00
zink zink: re-allow transient images during blitting 2026-01-28 16:17:58 +01:00