Repository navigation
recomp: cube T#s are cube arrays – the face coordinate's slice is sampled - #117
Conversation
…pled A cube T# with more than 6 layers got a TEXTURECUBEARRAY SRV, but translated shaders declared TextureCube for every DIM = cube image, and cube_dir kept only face % 8 of the face coordinate (face + 8 · cube): a cube array was read through the wrong view type and always as its first cube. image_get_resinfo returned depth 1. Every cube T# now gets a cube array view (of one cube too, since the T# says nothing at compile time about how many it has), the shader declares TextureCubeArray and samples / gathers at (direction, face / 8), and resinfo returns the layers (6 per cube) as the hardware does. A title's own TEXTURECUBEARRAY SRV keeps its NumCubes (it became 6 faces), and the test runner's cube texture can hold several cubes. Test gpu_cube_array_slices: two cubes, every layer its own colour, sampled at each face of both, and resinfo.
|
Merged – this one was not run on AMD before, it passes there. Checked on Windows 11 with an RX 9070 (RDNA4), merged together with the rest of #110–#129: |
|
Tested on an RTX 5070 Ti, merged onto f311ca5: 528 passed / 0 failed in plain, One risk, not a verified bug.
|
Since #117 translated shaders declare every cube T# as a TextureCubeArray, but dev_create_srv_x forwarded a title's own SRV description unchanged: a D3D12_SRV_DIMENSION_TEXTURECUBE view was bound to a shader that declares a cube array, a dimension mismatch D3D12 leaves undefined (the risk noted on #117). It now becomes TEXTURECUBEARRAY { First2DArrayFace 0, NumCubes 1 } with the view's mips and LOD clamp; format, mapping and every other view dimension are forwarded as before. Device #70 (views of memory) goes through the same path. Test srv_tests::a_cube_view_becomes_the_cube_array_of_one_cube. Co-Authored-By: Claude Code <[email protected]>
#105 item 2.
A cube T# with more than 6 layers got a
TEXTURECUBEARRAYSRV (desc::image_d3d12), but the shader declaredTextureCubefor every DIM = cube image andcube_dirkept onlyface % 8of the face coordinate (face + 8 · cube, asv_cubeidand the console compiler give it). So a cube array was read through the wrong view type and always as its first cube.image_get_resinforeturned depth 1.The fix:
TextureCubeArray; sample / gather use(cube_dir(...), face / 8);CalculateLevelOfDetailtakes the direction only; the gradient LOD path reads the size with the array overload;TEXTURECUBEARRAYSRV keeps itsNumCubesindev_create_srv_x/view_shape(it became 6 faces);Test
gpu_cube_array_slices: two cubes, a different value in every layer, sampled at each face of both, plus resinfo. Without the change it fails (resinfo[2, 2, 1, 1]). With it, it passes on a GTX 1650 under Wine (vkd3d-proton), and so do the other lib tests that run there. Not run on AMD or with the retail samples. The prelude and the HLSL of cube sampling change, so titles recompile those shaders once.