Răsfoiți Sursa

Another instance of parameters-that-should-have-been-undef (#718)

Jeff Noyle 8 ani în urmă
părinte
comite
5b3f3d7c16

+ 3 - 3
lib/HLSL/DxilAddPixelHitInstrumentation.cpp

@@ -251,8 +251,8 @@ bool DxilAddPixelHitInstrumentation::runOnModule(Module &M)
             auto WeightStruct = Builder.CreateCall(LoadWeight, {
             auto WeightStruct = Builder.CreateCall(LoadWeight, {
               LoadWeightOpcode, // i32 opcode
               LoadWeightOpcode, // i32 opcode
               HandleForUAV,     // %dx.types.Handle, ; resource handle
               HandleForUAV,     // %dx.types.Handle, ; resource handle
-              OffsetIntoUAV,    // i32 c0: index in elements into UAV
-              Zero32Arg         // i32 c1: byte offset into struct
+              OffsetIntoUAV,    // i32 c0: byte offset
+              UndefArg          // i32 c1: unused
             }, "WeightStruct");
             }, "WeightStruct");
             Weight = Builder.CreateExtractValue(WeightStruct, static_cast<uint64_t>(0LL), "Weight");
             Weight = Builder.CreateExtractValue(WeightStruct, static_cast<uint64_t>(0LL), "Weight");
           }
           }
@@ -265,7 +265,7 @@ bool DxilAddPixelHitInstrumentation::runOnModule(Module &M)
             AtomicBinOpcode,          // i32, ; opcode
             AtomicBinOpcode,          // i32, ; opcode
             HandleForUAV,   // %dx.types.Handle, ; resource handle
             HandleForUAV,   // %dx.types.Handle, ; resource handle
             AtomicAdd,      // i32, ; binary operation code : EXCHANGE, IADD, AND, OR, XOR, IMIN, IMAX, UMIN, UMAX
             AtomicAdd,      // i32, ; binary operation code : EXCHANGE, IADD, AND, OR, XOR, IMIN, IMAX, UMIN, UMAX
-            OffsetIndex,    // i32, ; coordinate c0: index in elements
+            OffsetIndex,    // i32, ; coordinate c0: byte offset
             UndefArg,       // i32, ; coordinate c1 (unused)
             UndefArg,       // i32, ; coordinate c1 (unused)
             UndefArg,       // i32, ; coordinate c2 (unused)
             UndefArg,       // i32, ; coordinate c2 (unused)
             Weight          // i32); increment value
             Weight          // i32); increment value

+ 1 - 1
tools/clang/test/HLSL/pix/pixelCounterAddPixelCost.hlsl

@@ -4,7 +4,7 @@
 // CHECK: %UAVIncResult = call i32 @dx.op.atomicBinOp.i32(i32 78, %dx.types.Handle %PIX_CountUAV_Handle, i32 0, i32 %ByteIndex, i32 undef, i32 undef, i32 1)
 // CHECK: %UAVIncResult = call i32 @dx.op.atomicBinOp.i32(i32 78, %dx.types.Handle %PIX_CountUAV_Handle, i32 0, i32 %ByteIndex, i32 undef, i32 undef, i32 1)
 
 
 // Check for pixel cost instructions:
 // Check for pixel cost instructions:
-// CHECK: %WeightStruct = call %dx.types.ResRet.i32 @dx.op.bufferLoad.i32(i32 68, %dx.types.Handle %PIX_CountUAV_Handle, i32 128, i32 0)
+// CHECK: %WeightStruct = call %dx.types.ResRet.i32 @dx.op.bufferLoad.i32(i32 68, %dx.types.Handle %PIX_CountUAV_Handle, i32 128, i32 undef)
 // CHECK: %Weight = extractvalue %dx.types.ResRet.i32 %WeightStruct, 0
 // CHECK: %Weight = extractvalue %dx.types.ResRet.i32 %WeightStruct, 0
 // CHECK: %OffsetByteIndex = add i32 %ByteIndex, 256
 // CHECK: %OffsetByteIndex = add i32 %ByteIndex, 256
 // CHECK: %UAVIncResult2 = call i32 @dx.op.atomicBinOp.i32(i32 78, %dx.types.Handle %PIX_CountUAV_Handle, i32 0, i32 %OffsetByteIndex, i32 undef, i32 undef, i32 %Weight)
 // CHECK: %UAVIncResult2 = call i32 @dx.op.atomicBinOp.i32(i32 78, %dx.types.Handle %PIX_CountUAV_Handle, i32 0, i32 %OffsetByteIndex, i32 undef, i32 undef, i32 %Weight)