Skip to content

Commit 3c95c62

Browse files
pixel shader bounds checks
1 parent eed09e8 commit 3c95c62

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/clang/unittests/HLSLExec/ExecutionTest.cpp

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

0 commit comments

Comments
 (0)