[llvm] [DirectX] Fix RawBuffer Loads of double vectors (PR #224695)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 13:01:15 PDT 2026


================
@@ -266,7 +266,7 @@ define void @load_rwtexture2d_float4_explicit_lod(<2 x i32> %coords) {
 define void @load_rwtexture2darray_float4(<3 x i32> %coords) {
   %texture = call target("dx.Texture", <4 x float>, 1, 0, 0, 7)
       @llvm.dx.resource.handlefrombinding.tdx.Texture_v4f32_1_0_0_7t(
-          i32 0, i32 0, i32 1, i32 0, ptr null)
+          i32 0, i32 1, i32 1, i32 0, ptr null)
----------------
farzonl wrote:

Great question. I think I ran into this because I mostly develop with debug builds and not rel with debug info.

So the issue here is the test reused UAV binding u0 for three different texture types:

1. RWTexture2D<float4>
2. RWTexture2DArray<float4>
3. RWTexture2DArray<float>

DXIL resource analysis requires each distinct UAV resource type in a module to have a unique binding. The duplicate bindings triggered a debug assertion before FileCheck ran.

So I reassigned the array resources to bindings u1 and u2. This does not change texture-load behavior; it only makes the synthetic test module valid.

Importantly, this was unrelated to the raw-buffer offset fix. Running the tests on the debug build exposed an existing issue in TextureLoad.ll.

@Icohedron  to confirm my understanding here.

https://github.com/llvm/llvm-project/pull/224695


More information about the llvm-commits mailing list