mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 03:39:57 -04:00
Fix out-of-bounds texture size query extracts in the SPIR-V translator
The SPIR-V generator emitted OpCompositeExtract with the guest's component index even when it exceeded the image's size vector. A 2D texture's OpImageQuerySizeLod returns a v2int, so a guest request for the third component (depth) produced an extract of index 2, which is invalid SPIR-V. RADV crashed while compiling those variants during shader preparation. Return the constant 1 for a component past the texture's dimensions, the depth of a 1D/2D/cube texture, and apply the same guard in the GLSL generator. build_xlate.py now expects the added patch.
This commit is contained in:
committed by
tangerineturtle1
parent
4223e0aa5c
commit
21eb3de1c2
@@ -99,8 +99,8 @@ def prepare_sources() -> Path:
|
||||
for junk in list(src.glob("src/*/obj")) + list(src.glob("src/*/bin")):
|
||||
shutil.rmtree(junk)
|
||||
patches = sorted((XLATE / "patches").glob("*.patch"))
|
||||
if len(patches) != 36:
|
||||
sys.exit(f"expected 36 patches, found {len(patches)}")
|
||||
if len(patches) != 37:
|
||||
sys.exit(f"expected 37 patches, found {len(patches)}")
|
||||
# build/xlate is inside this checkout, and git inside a repository reads a "diff --git" patch's paths from the
|
||||
# repository's top: those hunks fall outside the directory handed to --directory, git skips every file of the patch
|
||||
# and still exits 0. 0021-prmt-byte-permute.patch is the only one written in that form, so it used to be skipped in
|
||||
|
||||
Reference in New Issue
Block a user