Skip to content

Commit 62ca825

Browse files
Add support for WeightTextureQCOM
1 parent ef913b3 commit 62ca825

4 files changed

Lines changed: 312 additions & 0 deletions

File tree

common/output_stream.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,8 @@ std::string ToStringDecorationFlags(SpvReflectDecorationFlags decoration_flags)
804804
PRINT_AND_CLEAR_DECORATION_FLAG(sstream, decoration_flags, PATCH);
805805
PRINT_AND_CLEAR_DECORATION_FLAG(sstream, decoration_flags, PER_VERTEX);
806806
PRINT_AND_CLEAR_DECORATION_FLAG(sstream, decoration_flags, PER_TASK);
807+
PRINT_AND_CLEAR_DECORATION_FLAG(sstream, decoration_flags, WEIGHT_TEXTURE);
808+
PRINT_AND_CLEAR_DECORATION_FLAG(sstream, decoration_flags, BLOCK_MATCH_TEXTURE);
807809
#undef PRINT_AND_CLEAR_DECORATION_FLAG
808810
if (decoration_flags != 0) {
809811
// Unhandled SpvReflectDecorationFlags bit
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#version 450
2+
#extension GL_QCOM_image_processing : require
3+
4+
layout(set = 0, binding = 0) uniform texture2D inTex;
5+
layout(set = 0, binding = 3) uniform sampler linearSampler;
6+
layout(set = 0, binding = 1) uniform texture2DArray kernelTex;
7+
layout(set = 0, binding = 4) uniform sampler weightSampler;
8+
9+
layout(location = 0) out vec4 fragColor;
10+
layout(location = 0) in vec2 uv;
11+
12+
void main()
13+
{
14+
vec4 _32 = textureWeightedQCOM(sampler2D(inTex, linearSampler), uv, sampler2DArray(kernelTex, weightSampler));
15+
fragColor = _32;
16+
}
17+

tests/glsl/weight_texture_qcom.spv

1 KB
Binary file not shown.
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
%YAML 1.1
2+
---
3+
all_type_descriptions:
4+
- &td0
5+
id: 10
6+
op: 25
7+
type_name:
8+
struct_member_name:
9+
storage_class: -1 # NOT APPLICABLE
10+
type_flags: 0x00010008 # EXTERNAL_IMAGE FLOAT
11+
decoration_flags: 0x00000000 # NONE
12+
traits:
13+
numeric:
14+
scalar: { width: 32, signedness: 0 }
15+
vector: { component_count: 0 }
16+
matrix: { column_count: 0, row_count: 0, stride: 0 }
17+
image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=2D image_format=Unknown
18+
array: { dims_count: 0, dims: [], stride: 0 }
19+
member_count: 0
20+
members:
21+
- &td1
22+
id: 24
23+
op: 25
24+
type_name:
25+
struct_member_name:
26+
storage_class: -1 # NOT APPLICABLE
27+
type_flags: 0x00010008 # EXTERNAL_IMAGE FLOAT
28+
decoration_flags: 0x00000000 # NONE
29+
traits:
30+
numeric:
31+
scalar: { width: 32, signedness: 0 }
32+
vector: { component_count: 0 }
33+
matrix: { column_count: 0, row_count: 0, stride: 0 }
34+
image: { dim: 1, depth: 0, arrayed: 1, ms: 0, sampled: 1, image_format: 0 } # dim=2D image_format=Unknown
35+
array: { dims_count: 0, dims: [], stride: 0 }
36+
member_count: 0
37+
members:
38+
- &td2
39+
id: 14
40+
op: 26
41+
type_name:
42+
struct_member_name:
43+
storage_class: -1 # NOT APPLICABLE
44+
type_flags: 0x00020000 # EXTERNAL_SAMPLER
45+
decoration_flags: 0x00000000 # NONE
46+
traits:
47+
numeric:
48+
scalar: { width: 0, signedness: 0 }
49+
vector: { component_count: 0 }
50+
matrix: { column_count: 0, row_count: 0, stride: 0 }
51+
image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown
52+
array: { dims_count: 0, dims: [], stride: 0 }
53+
member_count: 0
54+
members:
55+
- &td3
56+
id: 20
57+
op: 23
58+
type_name:
59+
struct_member_name:
60+
storage_class: -1 # NOT APPLICABLE
61+
type_flags: 0x00000108 # VECTOR FLOAT
62+
decoration_flags: 0x00000000 # NONE
63+
traits:
64+
numeric:
65+
scalar: { width: 32, signedness: 0 }
66+
vector: { component_count: 2 }
67+
matrix: { column_count: 0, row_count: 0, stride: 0 }
68+
image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown
69+
array: { dims_count: 0, dims: [], stride: 0 }
70+
member_count: 0
71+
members:
72+
- &td4
73+
id: 7
74+
op: 23
75+
type_name:
76+
struct_member_name:
77+
storage_class: -1 # NOT APPLICABLE
78+
type_flags: 0x00000108 # VECTOR FLOAT
79+
decoration_flags: 0x00000000 # NONE
80+
traits:
81+
numeric:
82+
scalar: { width: 32, signedness: 0 }
83+
vector: { component_count: 4 }
84+
matrix: { column_count: 0, row_count: 0, stride: 0 }
85+
image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown
86+
array: { dims_count: 0, dims: [], stride: 0 }
87+
member_count: 0
88+
members:
89+
all_block_variables:
90+
- &bv0
91+
name:
92+
offset: 0
93+
absolute_offset: 0
94+
size: 0
95+
padded_size: 0
96+
decorations: 0x00000000 # NONE
97+
numeric:
98+
scalar: { width: 0, signedness: 0 }
99+
vector: { component_count: 0 }
100+
matrix: { column_count: 0, row_count: 0, stride: 0 }
101+
array: { dims_count: 0, dims: [], stride: 0 }
102+
flags: 0x00000000 # NONE
103+
member_count: 0
104+
members:
105+
type_description:
106+
- &bv1
107+
name:
108+
offset: 0
109+
absolute_offset: 0
110+
size: 0
111+
padded_size: 0
112+
decorations: 0x00000000 # NONE
113+
numeric:
114+
scalar: { width: 0, signedness: 0 }
115+
vector: { component_count: 0 }
116+
matrix: { column_count: 0, row_count: 0, stride: 0 }
117+
array: { dims_count: 0, dims: [], stride: 0 }
118+
flags: 0x00000000 # NONE
119+
member_count: 0
120+
members:
121+
type_description:
122+
- &bv2
123+
name:
124+
offset: 0
125+
absolute_offset: 0
126+
size: 0
127+
padded_size: 0
128+
decorations: 0x00000000 # NONE
129+
numeric:
130+
scalar: { width: 0, signedness: 0 }
131+
vector: { component_count: 0 }
132+
matrix: { column_count: 0, row_count: 0, stride: 0 }
133+
array: { dims_count: 0, dims: [], stride: 0 }
134+
flags: 0x00000000 # NONE
135+
member_count: 0
136+
members:
137+
type_description:
138+
- &bv3
139+
name:
140+
offset: 0
141+
absolute_offset: 0
142+
size: 0
143+
padded_size: 0
144+
decorations: 0x00000000 # NONE
145+
numeric:
146+
scalar: { width: 0, signedness: 0 }
147+
vector: { component_count: 0 }
148+
matrix: { column_count: 0, row_count: 0, stride: 0 }
149+
array: { dims_count: 0, dims: [], stride: 0 }
150+
flags: 0x00000000 # NONE
151+
member_count: 0
152+
members:
153+
type_description:
154+
all_descriptor_bindings:
155+
- &db0
156+
spirv_id: 12
157+
name: "inTex"
158+
binding: 0
159+
input_attachment_index: 0
160+
set: 0
161+
decoration_flags: 0x00000000 # NONE
162+
descriptor_type: 2 # VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
163+
resource_type: 4 # SRV
164+
image: { dim: 1, depth: 0, arrayed: 0, ms: 0, sampled: 1, image_format: 0 } # dim=2D image_format=Unknown
165+
block: *bv0 #
166+
array: { dims_count: 0, dims: [] }
167+
accessed: 1
168+
uav_counter_id: 4294967295
169+
uav_counter_binding:
170+
type_description: *td0
171+
word_offset: { binding: 91, set: 87 }
172+
- &db1
173+
spirv_id: 26
174+
name: "kernelTex"
175+
binding: 1
176+
input_attachment_index: 0
177+
set: 0
178+
decoration_flags: 0x00002000 # WEIGHT_TEXTURE
179+
descriptor_type: 2 # VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
180+
resource_type: 4 # SRV
181+
image: { dim: 1, depth: 0, arrayed: 1, ms: 0, sampled: 1, image_format: 0 } # dim=2D image_format=Unknown
182+
block: *bv1 #
183+
array: { dims_count: 0, dims: [] }
184+
accessed: 1
185+
uav_counter_id: 4294967295
186+
uav_counter_binding:
187+
type_description: *td1
188+
word_offset: { binding: 111, set: 107 }
189+
- &db2
190+
spirv_id: 16
191+
name: "linearSampler"
192+
binding: 3
193+
input_attachment_index: 0
194+
set: 0
195+
decoration_flags: 0x00000000 # NONE
196+
descriptor_type: 0 # VK_DESCRIPTOR_TYPE_SAMPLER
197+
resource_type: 1 # SAMPLER
198+
image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown
199+
block: *bv2 #
200+
array: { dims_count: 0, dims: [] }
201+
accessed: 1
202+
uav_counter_id: 4294967295
203+
uav_counter_binding:
204+
type_description: *td2
205+
word_offset: { binding: 99, set: 95 }
206+
- &db3
207+
spirv_id: 28
208+
name: "weightSampler"
209+
binding: 4
210+
input_attachment_index: 0
211+
set: 0
212+
decoration_flags: 0x00000000 # NONE
213+
descriptor_type: 0 # VK_DESCRIPTOR_TYPE_SAMPLER
214+
resource_type: 1 # SAMPLER
215+
image: { dim: 0, depth: 0, arrayed: 0, ms: 0, sampled: 0, image_format: 0 } # dim=1D image_format=Unknown
216+
block: *bv3 #
217+
array: { dims_count: 0, dims: [] }
218+
accessed: 1
219+
uav_counter_id: 4294967295
220+
uav_counter_binding:
221+
type_description: *td2
222+
word_offset: { binding: 119, set: 115 }
223+
all_interface_variables:
224+
- &iv0
225+
spirv_id: 22
226+
name: "uv"
227+
location: 0
228+
storage_class: 1 # Input
229+
semantic:
230+
decoration_flags: 0x00000000 # NONE
231+
built_in: -1 # ??? (-1)
232+
numeric:
233+
scalar: { width: 32, signedness: 0 }
234+
vector: { component_count: 2 }
235+
matrix: { column_count: 0, row_count: 0, stride: 0 }
236+
array: { dims_count: 0, dims: [], stride: 0 }
237+
member_count: 0
238+
members:
239+
format: 103 # VK_FORMAT_R32G32_SFLOAT
240+
type_description: *td3
241+
word_offset: { location: 103 }
242+
- &iv1
243+
spirv_id: 9
244+
name: "fragColor"
245+
location: 0
246+
storage_class: 3 # Output
247+
semantic:
248+
decoration_flags: 0x00000000 # NONE
249+
built_in: -1 # ??? (-1)
250+
numeric:
251+
scalar: { width: 32, signedness: 0 }
252+
vector: { component_count: 4 }
253+
matrix: { column_count: 0, row_count: 0, stride: 0 }
254+
array: { dims_count: 0, dims: [], stride: 0 }
255+
member_count: 0
256+
members:
257+
format: 109 # VK_FORMAT_R32G32B32A32_SFLOAT
258+
type_description: *td4
259+
word_offset: { location: 83 }
260+
module:
261+
generator: 8 # Khronos Glslang Reference Front End
262+
entry_point_name: "main"
263+
entry_point_id: 4
264+
source_language: 2 # GLSL
265+
source_language_version: 450
266+
spirv_execution_model: 4 # Fragment
267+
shader_stage: 0x00000010 # PS
268+
descriptor_binding_count: 4
269+
descriptor_bindings:
270+
- *db0 # "inTex"
271+
- *db1 # "kernelTex"
272+
- *db2 # "linearSampler"
273+
- *db3 # "weightSampler"
274+
descriptor_set_count: 1
275+
descriptor_sets:
276+
- set: 0
277+
binding_count: 4
278+
bindings:
279+
- *db0 # "inTex"
280+
- *db1 # "kernelTex"
281+
- *db2 # "linearSampler"
282+
- *db3 # "weightSampler"
283+
input_variable_count: 1,
284+
input_variables:
285+
- *iv0 # "uv"
286+
output_variable_count: 1,
287+
output_variables:
288+
- *iv1 # "fragColor"
289+
push_constant_count: 0,
290+
push_constants:
291+
specialization_constant_count: 0,
292+
specialization_constants:
293+
...

0 commit comments

Comments
 (0)