@@ -192,6 +192,9 @@ func.func @image_write_texel_type_mismatch(%arg0 : !spirv.image<f32, Dim2D, NoDe
192
192
// spirv.ImageSampleExplicitLod
193
193
//===----------------------------------------------------------------------===//
194
194
195
+ // No need to have a negative test for Dim being Buffer as this is already handled
196
+ // by SampledImageType logic.
197
+
195
198
func.func @sample_explicit_lod (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, %arg1 : vector <2 xf32 >, %arg2 : f32 ) -> () {
196
199
// CHECK: {{%.*}} = spirv.ImageSampleExplicitLod {{%.*}}, {{%.*}} ["Lod"], {{%.*}} : !spirv.sampled_image<!spirv.image<f32, Dim2D, NoDepth, NonArrayed, SingleSampled, NeedSampler, Rgba8>>, vector<2xf32>, f32 -> vector<4xf32>
197
200
%0 = spirv.ImageSampleExplicitLod %arg0 , %arg1 [" Lod" ], %arg2 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, vector <2 xf32 >, f32 -> vector <4 xf32 >
@@ -200,14 +203,6 @@ func.func @sample_explicit_lod(%arg0 : !spirv.sampled_image<!spirv.image<f32, Di
200
203
201
204
// -----
202
205
203
- func.func @sample_explicit_lod_buffer_dim (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Buffer , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, %arg1 : vector <2 xf32 >, %arg2 : f32 ) -> () {
204
- // expected-error @+1 {{the Dim operand of the underlying image must not be Buffer}}
205
- %0 = spirv.ImageSampleExplicitLod %arg0 , %arg1 [" Lod" ], %arg2 : !spirv.sampled_image <!spirv.image <f32 , Buffer , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, vector <2 xf32 >, f32 -> vector <4 xf32 >
206
- spirv.Return
207
- }
208
-
209
- // -----
210
-
211
206
func.func @sample_explicit_lod_multi_sampled (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , MultiSampled , NeedSampler , Rgba8 >>, %arg1 : vector <2 xf32 >, %arg2 : f32 ) -> () {
212
207
// expected-error @+1 {{the MS operand of the underlying image type must be SingleSampled}}
213
208
%0 = spirv.ImageSampleExplicitLod %arg0 , %arg1 [" Lod" ], %arg2 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , MultiSampled , NeedSampler , Rgba8 >>, vector <2 xf32 >, f32 -> vector <4 xf32 >
@@ -236,6 +231,9 @@ func.func @sample_explicit_lod_no_lod(%arg0 : !spirv.sampled_image<!spirv.image<
236
231
// spirv.ImageSampleImplicitLod
237
232
//===----------------------------------------------------------------------===//
238
233
234
+ // No need to have a negative test for Dim being Buffer as this is already handled
235
+ // by SampledImageType logic.
236
+
239
237
func.func @sample_implicit_lod (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, %arg1 : vector <2 xf32 >) -> () {
240
238
// CHECK: {{%.*}} = spirv.ImageSampleImplicitLod {{%.*}}, {{%.*}} : !spirv.sampled_image<!spirv.image<f32, Dim2D, NoDepth, NonArrayed, SingleSampled, NeedSampler, Rgba8>>, vector<2xf32> -> vector<4xf32>
241
239
%0 = spirv.ImageSampleImplicitLod %arg0 , %arg1 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, vector <2 xf32 > -> vector <4 xf32 >
@@ -244,14 +242,6 @@ func.func @sample_implicit_lod(%arg0 : !spirv.sampled_image<!spirv.image<f32, Di
244
242
245
243
// -----
246
244
247
- func.func @sample_implicit_lod_buffer (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Buffer , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, %arg1 : vector <2 xf32 >) -> () {
248
- // expected-error @+1 {{the Dim operand of the underlying image must not be Buffer}}
249
- %0 = spirv.ImageSampleImplicitLod %arg0 , %arg1 : !spirv.sampled_image <!spirv.image <f32 , Buffer , NoDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, vector <2 xf32 > -> vector <4 xf32 >
250
- spirv.Return
251
- }
252
-
253
- // -----
254
-
255
245
func.func @sample_implicit_lod_multi_sampled (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , MultiSampled , NeedSampler , Rgba8 >>, %arg1 : vector <2 xf32 >) -> () {
256
246
// expected-error @+1 {{the MS operand of the underlying image type must be SingleSampled}}
257
247
%0 = spirv.ImageSampleImplicitLod %arg0 , %arg1 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , NoDepth , NonArrayed , MultiSampled , NeedSampler , Rgba8 >>, vector <2 xf32 > -> vector <4 xf32 >
@@ -272,6 +262,9 @@ func.func @sample_implicit_lod_wrong_result(%arg0 : !spirv.sampled_image<!spirv.
272
262
// spirv.ImageSampleProjDrefImplicitLod
273
263
//===----------------------------------------------------------------------===//
274
264
265
+ // No need to have a negative test for Dim being Buffer as this is already handled
266
+ // by SampledImageType logic.
267
+
275
268
func.func @sample_implicit_proj_dref (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , IsDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, %arg1 : vector <4 xf32 >, %arg2 : f32 ) -> () {
276
269
// CHECK: {{%.*}} = spirv.ImageSampleProjDrefImplicitLod {{%.*}}, {{%.*}}, {{%.*}} : !spirv.sampled_image<!spirv.image<f32, Dim2D, IsDepth, NonArrayed, SingleSampled, NeedSampler, Rgba8>>, vector<4xf32>, f32 -> f32
277
270
%0 = spirv.ImageSampleProjDrefImplicitLod %arg0 , %arg1 , %arg2 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , IsDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, vector <4 xf32 >, f32 -> f32
@@ -280,14 +273,6 @@ func.func @sample_implicit_proj_dref(%arg0 : !spirv.sampled_image<!spirv.image<f
280
273
281
274
// -----
282
275
283
- func.func @sample_implicit_proj_dref_buffer_dim (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Buffer , IsDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, %arg1 : vector <4 xf32 >, %arg2 : f32 ) -> () {
284
- // expected-error @+1 {{the Dim operand of the underlying image must not be Buffer}}
285
- %0 = spirv.ImageSampleProjDrefImplicitLod %arg0 , %arg1 , %arg2 : !spirv.sampled_image <!spirv.image <f32 , Buffer , IsDepth , NonArrayed , SingleSampled , NeedSampler , Rgba8 >>, vector <4 xf32 >, f32 -> f32
286
- spirv.Return
287
- }
288
-
289
- // -----
290
-
291
276
func.func @sample_implicit_proj_dref_multi_sampled (%arg0 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , IsDepth , NonArrayed , MultiSampled , NeedSampler , Rgba8 >>, %arg1 : vector <4 xf32 >, %arg2 : f32 ) -> () {
292
277
// expected-error @+1 {{the MS operand of the underlying image type must be SingleSampled}}
293
278
%0 = spirv.ImageSampleProjDrefImplicitLod %arg0 , %arg1 , %arg2 : !spirv.sampled_image <!spirv.image <f32 , Dim2D , IsDepth , NonArrayed , MultiSampled , NeedSampler , Rgba8 >>, vector <4 xf32 >, f32 -> f32
0 commit comments