|
1 |
| -// RUN: %dxc -T ps_6_6 -E main -fcgl %s -spirv | FileCheck %s |
| 1 | +// RUN: %dxc -T ps_6_6 -E main -fcgl %s -spirv | FileCheck %s --check-prefixes=CHECK,INFER |
| 2 | +// RUN: %dxc -fspv-use-unknown-image-format -T ps_6_6 -E main -fcgl %s -spirv | FileCheck %s --check-prefixes=CHECK,UNKNOWN |
| 3 | + |
| 4 | +// Before vulkan1.3, we should be trying to infer the image type for because |
| 5 | +// we cannot necessarily use Unknown. However in VK1.3 and later, we can use |
| 6 | +// Unknown. |
2 | 7 |
|
3 | 8 | // CHECK: OpCapability SampledBuffer
|
4 |
| -// CHECK: OpCapability StorageImageExtendedFormats |
| 9 | +// INFER: OpCapability StorageImageExtendedFormats |
5 | 10 |
|
6 |
| -// CHECK: %type_buffer_image = OpTypeImage %int Buffer 2 0 0 2 R32i |
| 11 | +// INFER: %type_buffer_image = OpTypeImage %int Buffer 2 0 0 2 R32i |
| 12 | +// UNKNOWN: %type_buffer_image = OpTypeImage %int Buffer 2 0 0 2 Unknown |
7 | 13 | // CHECK: %_ptr_UniformConstant_type_buffer_image = OpTypePointer UniformConstant %type_buffer_image
|
8 | 14 | RasterizerOrderedBuffer<int> introvbuf;
|
9 |
| -// CHECK: %type_buffer_image_0 = OpTypeImage %uint Buffer 2 0 0 2 R32ui |
| 15 | +// INFER: %type_buffer_image_0 = OpTypeImage %uint Buffer 2 0 0 2 R32ui |
| 16 | +// UNKNOWN: %type_buffer_image_0 = OpTypeImage %uint Buffer 2 0 0 2 Unknown |
10 | 17 | // CHECK: %_ptr_UniformConstant_type_buffer_image_0 = OpTypePointer UniformConstant %type_buffer_image_0
|
11 | 18 | RasterizerOrderedBuffer<uint> uintrovbuf;
|
12 |
| -// CHECK: %type_buffer_image_1 = OpTypeImage %float Buffer 2 0 0 2 R32f |
| 19 | +// INFER: %type_buffer_image_1 = OpTypeImage %float Buffer 2 0 0 2 R32f |
| 20 | +// UNKNOWN: %type_buffer_image_1 = OpTypeImage %float Buffer 2 0 0 2 Unknown |
13 | 21 | // CHECK: %_ptr_UniformConstant_type_buffer_image_1 = OpTypePointer UniformConstant %type_buffer_image_1
|
14 | 22 | RasterizerOrderedBuffer<float> floatrovbuf;
|
15 | 23 |
|
16 |
| -// CHECK: %type_buffer_image_2 = OpTypeImage %int Buffer 2 0 0 2 Rg32i |
17 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_2 = OpTypePointer UniformConstant %type_buffer_image_2 |
| 24 | +// INFER: %type_buffer_image_2 = OpTypeImage %int Buffer 2 0 0 2 Rg32i |
| 25 | +// INFER: %_ptr_UniformConstant_type_buffer_image_2 = OpTypePointer UniformConstant %type_buffer_image_2 |
18 | 26 | RasterizerOrderedBuffer<int2> int2rovbuf;
|
19 |
| -// CHECK: %type_buffer_image_3 = OpTypeImage %uint Buffer 2 0 0 2 Rg32ui |
20 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_3 = OpTypePointer UniformConstant %type_buffer_image_3 |
| 27 | +// INFER: %type_buffer_image_3 = OpTypeImage %uint Buffer 2 0 0 2 Rg32ui |
| 28 | +// INFER: %_ptr_UniformConstant_type_buffer_image_3 = OpTypePointer UniformConstant %type_buffer_image_3 |
21 | 29 | RasterizerOrderedBuffer<uint2> uint2rovbuf;
|
22 |
| -// CHECK: %type_buffer_image_4 = OpTypeImage %float Buffer 2 0 0 2 Rg32f |
23 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_4 = OpTypePointer UniformConstant %type_buffer_image_4 |
| 30 | +// INFER: %type_buffer_image_4 = OpTypeImage %float Buffer 2 0 0 2 Rg32f |
| 31 | +// INFER: %_ptr_UniformConstant_type_buffer_image_4 = OpTypePointer UniformConstant %type_buffer_image_4 |
24 | 32 | RasterizerOrderedBuffer<float2> float2rovbuf;
|
25 | 33 |
|
26 |
| -// CHECK: %type_buffer_image_5 = OpTypeImage %int Buffer 2 0 0 2 Unknown |
27 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_5 = OpTypePointer UniformConstant %type_buffer_image_5 |
28 |
| -// CHECK: %type_buffer_image_6 = OpTypeImage %int Buffer 2 0 0 2 Rgba32i |
29 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_6 = OpTypePointer UniformConstant %type_buffer_image_6 |
| 34 | +// INFER: %type_buffer_image_5 = OpTypeImage %int Buffer 2 0 0 2 Unknown |
| 35 | +// INFER: %_ptr_UniformConstant_type_buffer_image_5 = OpTypePointer UniformConstant %type_buffer_image_5 |
| 36 | +// INFER: %type_buffer_image_6 = OpTypeImage %int Buffer 2 0 0 2 Rgba32i |
| 37 | +// INFER: %_ptr_UniformConstant_type_buffer_image_6 = OpTypePointer UniformConstant %type_buffer_image_6 |
30 | 38 | RasterizerOrderedBuffer<int3> int3rovbuf;
|
31 | 39 | RasterizerOrderedBuffer<int4> int4rovbuf;
|
32 |
| -// CHECK: %type_buffer_image_7 = OpTypeImage %uint Buffer 2 0 0 2 Unknown |
33 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_7 = OpTypePointer UniformConstant %type_buffer_image_7 |
34 |
| -// CHECK: %type_buffer_image_8 = OpTypeImage %uint Buffer 2 0 0 2 Rgba32ui |
35 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_8 = OpTypePointer UniformConstant %type_buffer_image_8 |
| 40 | +// INFER: %type_buffer_image_7 = OpTypeImage %uint Buffer 2 0 0 2 Unknown |
| 41 | +// INFER: %_ptr_UniformConstant_type_buffer_image_7 = OpTypePointer UniformConstant %type_buffer_image_7 |
| 42 | +// INFER: %type_buffer_image_8 = OpTypeImage %uint Buffer 2 0 0 2 Rgba32ui |
| 43 | +// INFER: %_ptr_UniformConstant_type_buffer_image_8 = OpTypePointer UniformConstant %type_buffer_image_8 |
36 | 44 | RasterizerOrderedBuffer<uint3> uint3rovbuf;
|
37 | 45 | RasterizerOrderedBuffer<uint4> uint4rovbuf;
|
38 |
| -// CHECK: %type_buffer_image_9 = OpTypeImage %float Buffer 2 0 0 2 Unknown |
39 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_9 = OpTypePointer UniformConstant %type_buffer_image_9 |
40 |
| -// CHECK: %type_buffer_image_10 = OpTypeImage %float Buffer 2 0 0 2 Rgba32f |
41 |
| -// CHECK: %_ptr_UniformConstant_type_buffer_image_10 = OpTypePointer UniformConstant %type_buffer_image_10 |
| 46 | +// INFER: %type_buffer_image_9 = OpTypeImage %float Buffer 2 0 0 2 Unknown |
| 47 | +// INFER: %_ptr_UniformConstant_type_buffer_image_9 = OpTypePointer UniformConstant %type_buffer_image_9 |
| 48 | +// INFER: %type_buffer_image_10 = OpTypeImage %float Buffer 2 0 0 2 Rgba32f |
| 49 | +// INFER: %_ptr_UniformConstant_type_buffer_image_10 = OpTypePointer UniformConstant %type_buffer_image_10 |
42 | 50 | RasterizerOrderedBuffer<float3> float3rovbuf;
|
43 | 51 | RasterizerOrderedBuffer<float4> float4rovbuf;
|
44 | 52 |
|
45 |
| -// CHECK: %introvbuf = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant |
46 |
| -// CHECK: %uintrovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_0 UniformConstant |
47 |
| -// CHECK: %floatrovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_1 UniformConstant |
48 |
| -// CHECK: %int2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_2 UniformConstant |
49 |
| -// CHECK: %uint2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_3 UniformConstant |
50 |
| -// CHECK: %float2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_4 UniformConstant |
51 |
| -// CHECK: %int3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_5 UniformConstant |
52 |
| -// CHECK: %int4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_6 UniformConstant |
53 |
| -// CHECK: %uint3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_7 UniformConstant |
54 |
| -// CHECK: %uint4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_8 UniformConstant |
55 |
| -// CHECK: %float3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_9 UniformConstant |
56 |
| -// CHECK: %float4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_10 UniformConstant |
| 53 | +// INFER: %introvbuf = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant |
| 54 | +// INFER: %uintrovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_0 UniformConstant |
| 55 | +// INFER: %floatrovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_1 UniformConstant |
| 56 | +// INFER: %int2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_2 UniformConstant |
| 57 | +// INFER: %uint2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_3 UniformConstant |
| 58 | +// INFER: %float2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_4 UniformConstant |
| 59 | +// INFER: %int3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_5 UniformConstant |
| 60 | +// INFER: %int4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_6 UniformConstant |
| 61 | +// INFER: %uint3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_7 UniformConstant |
| 62 | +// INFER: %uint4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_8 UniformConstant |
| 63 | +// INFER: %float3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_9 UniformConstant |
| 64 | +// INFER: %float4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_10 UniformConstant |
| 65 | + |
| 66 | +// UNKNOWN: %introvbuf = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant |
| 67 | +// UNKNOWN: %uintrovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_0 UniformConstant |
| 68 | +// UNKNOWN: %floatrovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_1 UniformConstant |
| 69 | +// UNKNOWN: %int2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant |
| 70 | +// UNKNOWN: %uint2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_0 UniformConstant |
| 71 | +// UNKNOWN: %float2rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_1 UniformConstant |
| 72 | +// UNKNOWN: %int3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant |
| 73 | +// UNKNOWN: %int4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image UniformConstant |
| 74 | +// UNKNOWN: %uint3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_0 UniformConstant |
| 75 | +// UNKNOWN: %uint4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_0 UniformConstant |
| 76 | +// UNKNOWN: %float3rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_1 UniformConstant |
| 77 | +// UNKNOWN: %float4rovbuf = OpVariable %_ptr_UniformConstant_type_buffer_image_1 UniformConstant |
57 | 78 |
|
58 | 79 | void main() {}
|
59 | 80 |
|
0 commit comments