blob: aa9763e1700523a328c4b98c56061bfa58ed664e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage compute -entry computeMain -O0
//CHECK: %[[NULLPTR_VAL:[a-zA-Z0-9_]+]] = OpConvertUToPtr %_ptr_PhysicalStorageBuffer_int %{{.*}}
//CHECK: OpStore %ptr %[[NULLPTR_VAL]]
[vk::push_constant] int* dest;
[numthreads(1, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
int* ptr = nullptr;
if (dispatchThreadID.x % 2 == 0) ptr = dest;
if (ptr) *ptr = 123;
}
|