mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #154] [CLOSED] rdna2spirv: implicit samples read the T# FORMAT view in every dimension (SHADER-1404) #207
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#207
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/154
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/9886📝 Commits (2)
fd8ab16rdna2spirv: implicit samples read the T# FORMAT view in every dimension (SHADER-1404)fde408dgpu: a 2D-array UINT fixture for implicit typed samples (SHADER-1404)📊 Changes
7 files changed (+188 additions, -16 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
runtime/test/shaders/check.py(+5 -1)➕
runtime/test/shaders/ps_sample_implicit_uint_array.asm(+29 -0)📝
runtime/test/vk_texture_test.cpp(+16 -6)📝
scripts/run_gpu_tests.py(+2 -2)➕
tests/semantic/test_sample_implicit_dims.py(+117 -0)📝
tools/rdna2spirv.py(+18 -6)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue as: SHADER-1404 — https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116603786
Depends on: none
What and why
image_samplechose the UINT/SINT sampled view the T# FORMAT selects only when the stage waspsand the dimension 2D (tools/rdna2spirv.py). An integer 2D-array, cube, 3D or 1D texture, and any implicit sample outside the pixel stage, was sampled through the float view: the result VGPRs held a converted float instead of the integer texel the measured T# FORMAT rule indocs/design.mdreturns.Every
image_sampleform now takes the typed read thatimage_load,image_sample_landimage_sample_lzalready take. The pixel stage keeps the implicit LOD as the quad derivatives, asGrad, at the width the dimension samples — two components for 2D, 2D-array and cube (the array layer is not differentiated), three for 3D, scalar for 1D — which is the vectorOpDPdxdifferentiates. Outside the pixel stage there are no derivatives, so the sample isLod 0.image_sample_c*stays on the float view (a depth compare takes aDrefview); the bias (_b) and offset (_o) forms are out of this change.docs/design.md: the row "Implicit 2D pixel-shader integer samples" becomes "Implicit integer samples", with the dimension/stage rule and what is checked where.Note:
#9667proposed the same fix on a base from before#9517merged and was closed unmerged;mainstill had the 2D/ps-only condition.Tested
Linux (CachyOS), Intel UHD Graphics 620 (CML GT2) through Mesa 26.2.5 (ANV), no game files. Python 3.14.8, SPIRV-Tools v2026.4 (
spirv-as/spirv-val), LLVM 23.1.4 (llvm-mc).python -I tests/semantic/test_sample_implicit_dims.py -v: 3 tests OK — every dimension in the pixel stage (the alias each dimension loads, the three sample types, theOpDPdx/OpDPdywidth), the float view still sampled for a float format, and the compute stage asLod %f0;spirv-asandspirv-val --target-env vulkan1.2on every module.python -I scripts/run_semantic_tests.py tests/semantic: 460 files, 6,049 tests, 2 files failed (test_exec_computed,test_image_atomics_guard). Both fail with the same counts onmainat2d53a80without this change.python -I -m unittest discover -s tests/semantic -p 'test_sample*.py'and-p 'test_image_gather4_variants.py': 31 and 13 tests OK.spirv-valcounts over the 26,503 shaders.python -I scripts/run_gpu_tests.py --build runtime/build --work /tmp/opencode/gputest --filter ps_sample_implicit— 3/3 pass.ps_sample_implicit_sintandps_sample_implicit_uintkeep the 2D path; the newps_sample_implicit_uint_arraysamples the unsigned two-mip image through a one-layer 2D_ARRAY view (non-2D implicit sample), 4096/4096 pixels exact in each pass. With the translator at2d53a80the array fixture fails ((0,0): RGBA32F bits (0, 0, 0, 0) != (1065353216, 0, 0, 1065353216)), so the fixture catches the regression.AI-assisted: yes (opencode, deepseek-v4.1-flash-free).
Checklist
docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.