瀏覽代碼

allows Texture2DMS(Array).Load() to have offsets (#1254)

John Porto 7 年之前
父節點
當前提交
94249fbc07
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 2 2
      lib/HLSL/DxilResource.cpp
  2. 3 1
      tools/clang/test/CodeGenHLSL/srv_ms_load1.hlsl

+ 2 - 2
lib/HLSL/DxilResource.cpp

@@ -200,12 +200,12 @@ unsigned DxilResource::GetNumOffsets(Kind ResourceKind) {
       0, // Invalid = 0,
       1, // Texture1D,
       2, // Texture2D,
-      0, // Texture2DMS,
+      2, // Texture2DMS,
       3, // Texture3D,
       0, // TextureCube,
       1, // Texture1DArray,
       2, // Texture2DArray,
-      0, // Texture2DMSArray,
+      2, // Texture2DMSArray,
       0, // TextureCubeArray,
       0, // TypedBuffer,
       0, // RawBuffer,

+ 3 - 1
tools/clang/test/CodeGenHLSL/srv_ms_load1.hlsl

@@ -1,6 +1,8 @@
 // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
 
-// CHECK: textureLoad
+// CHECK-DAG: textureLoad.f32({{.*}}, i32 undef, i32 undef, i32 undef)
+// CHECK-DAG: textureLoad.f32({{.*}}, i32 -5, i32 7, i32 undef)
+// CHECK-DAG: textureLoad.f32({{.*}}, i32 0, i32 0, i32 undef)
 
 Texture2DMS<float3> srv1 : register(t3);