Skip to content

Commit ad20ee6

Browse files
pixel shader bounds checks
1 parent f5bfc88 commit ad20ee6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12509,6 +12509,13 @@ float4 vs_main(uint vid : SV_VertexID) : SV_Position {
1250912509
float4 ps_main() : SV_Target {
1251012510
uint threadIdx;
1251112511
InterlockedAdd(AtomicCounter[0], 1, threadIdx);
12512+
// threadIdx may exceed NUM_THREADS, but bounds checking on the vector
12513+
// loads/stores will prevent any faults from occurring. This lets us
12514+
// exercise the CoopVec implementation on more threads, giving us
12515+
// further confidence that there are no bad interactions between "good"
12516+
// threads and threads that fail bounds checking and operate on all-zero
12517+
// input data. This also gives us some additional testing of long vector
12518+
// bounds-checking.
1251212519
RunCoopVecTest(threadIdx);
1251312520
return float4(1, 1, 1, 1);
1251412521
}
@@ -13094,7 +13101,8 @@ float4 vs_main(uint vid : SV_VertexID) : SV_Position {
1309413101
float4 ps_main() : SV_Target {
1309513102
uint threadIdx;
1309613103
InterlockedAdd(AtomicCounter[0], 1, threadIdx);
13097-
RunCoopVecTest(threadIdx);
13104+
if (threadIdx < NUM_THREADS)
13105+
RunCoopVecTest(threadIdx);
1309813106
return float4(1, 1, 1, 1);
1309913107
}
1310013108
)";

0 commit comments

Comments
 (0)