mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #132] [CLOSED] rdna2spirv: image_sample reads integer textures through the typed view in every dimension and stage (SHADER-1404) #183
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#183
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/132
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/9863📝 Commits (2)
a16ba20rdna2spirv: image_sample reads integer textures through the typed view in every dimension and stage (SHADER-1404)0352291vk_texture_test: integer 2D-array implicit image_sample fixtures (SHADER-1404)📊 Changes
7 files changed (+163 additions, -30 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
runtime/test/shaders/ps_sample_array_sint.asm(+26 -0)➕
runtime/test/shaders/ps_sample_array_uint.asm(+25 -0)📝
runtime/test/vk_texture_test.cpp(+44 -8)📝
scripts/run_gpu_tests.py(+5 -2)📝
tests/semantic/test_sample_typed_dims.py(+45 -12)📝
tools/rdna2spirv.py(+17 -7)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):SHADER-1404 (up for grabs in
#9677; I could not claim it there because comments are limited to collaborators).image_sample(implicit LOD) took the typed UINT/SINT read only in a 2D pixel shader. A UINT/SINT 2D-array, 3D, cube or 1D texture, or any integer texture sampled outside a pixel shader, went through the float view, so the VGPRs held a converted float instead of the integer texel.image_sample_l/image_sample_lzalready usedimage_read_typedin every dimension.Now
image_sampleusesimage_read_typedin every dimension and stage:OpImageSampleExplicitLod ... GradwithOpDPdx/OpDPdytaken before the per-format branch, over the coordinates that have a derivative (grad_width): s for 1D; s, t for 2D, 2D-array and cube (its 6-layer 2D-array view, as the float path samples it); s, t, r for 3D. The array layer has no derivative.docs/design.md: the "in every dimension" contract row now coversimage_sampleand says how the implicit LOD is lowered.Tested:
tests/semantic/test_sample_typed_dims.py: extended toimage_sample(alias and sampled-image type per dimension, gradient width and theOpVectorShufflefor array/cube, LOD 0 in a vertex shader). The new cases fail on main (13 failures) and pass with this change.python -I scripts/run_semantic_tests.py tests/semantic: 459 files, 6048 tests. Four files fail identically with and without this change (test_exec_computed,test_image_atomics_guard,test_sopc_validation,test_unary_f16_validation); two of them needspirv-as/spirv-val, which are not installed here.tests/test_docs_links.py,python -m compileall.spirv-valon the new modules (the test has aspirv-valcase, skipped here) and a GPU readback on a non-2D integer texture. GPU available for a fixture: NVIDIA RTX 3060 (Windows).No game files. AI-assisted (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.