Kévin Petit | 85bcee0 | 2021-08-03 18:21:30 +0100 | [diff] [blame] | 1 | ; RUN: clspv-opt -SPIRVProducerPass %s -o %t.ll -producer-out-file %t.spv -spv-version=1.4 |
| 2 | ; RUN: spirv-dis %t.spv -o %t.spvasm |
| 3 | ; RUN: FileCheck %s < %t.spvasm |
| 4 | ; RUN: spirv-val --target-env vulkan1.1spv1.4 %t.spv |
| 5 | |
alan-baker | 448d852 | 2021-08-10 14:54:36 -0400 | [diff] [blame^] | 6 | ; CHECK: OpEntryPoint GLCompute %{{.*}} "test" [[sampler:%[a-zA-Z0-9_]+]] |
Kévin Petit | 85bcee0 | 2021-08-03 18:21:30 +0100 | [diff] [blame] | 7 | ; CHECK: [[sampler_type:%[a-zA-Z0-9_]+]] = OpTypeSampler |
| 8 | ; CHECK: [[sampler_ptr:%[a-zA-Z0-9_]+]] = OpTypePointer UniformConstant [[sampler_type]] |
| 9 | ; CHECK: [[sampler]] = OpVariable [[sampler_ptr]] UniformConstant |
| 10 | |
| 11 | target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 12 | target triple = "spir-unknown-unknown" |
| 13 | |
| 14 | %opencl.image2d_ro_t.float.sampled = type opaque |
| 15 | %opencl.sampler_t = type opaque |
| 16 | |
| 17 | @__spirv_WorkgroupSize = local_unnamed_addr addrspace(8) global <3 x i32> zeroinitializer |
| 18 | |
| 19 | declare <4 x float> @_Z11read_imagef14ocl_image2d_ro11ocl_samplerDv2_f.opencl.image2d_ro_t.float.sampled(%opencl.image2d_ro_t.float.sampled addrspace(1)*, %opencl.sampler_t addrspace(2)*, <2 x float>) |
| 20 | |
| 21 | define spir_kernel void @test(%opencl.image2d_ro_t.float.sampled addrspace(1)* %img, <4 x float> addrspace(1)* nocapture %out) !clspv.pod_args_impl !4 { |
| 22 | entry: |
| 23 | %0 = call %opencl.image2d_ro_t.float.sampled addrspace(1)* @_Z14clspv.resource.0(i32 1, i32 0, i32 6, i32 0, i32 0, i32 0) |
| 24 | %1 = call { [0 x <4 x float>] } addrspace(1)* @_Z14clspv.resource.1(i32 1, i32 1, i32 0, i32 1, i32 1, i32 0) |
| 25 | %2 = getelementptr { [0 x <4 x float>] }, { [0 x <4 x float>] } addrspace(1)* %1, i32 0, i32 0, i32 0 |
| 26 | %3 = call %opencl.sampler_t addrspace(2)* @_Z25clspv.sampler_var_literal(i32 0, i32 0, i32 16) |
| 27 | %4 = tail call <4 x float> @_Z11read_imagef14ocl_image2d_ro11ocl_samplerDv2_f.opencl.image2d_ro_t.float.sampled(%opencl.image2d_ro_t.float.sampled addrspace(1)* %0, %opencl.sampler_t addrspace(2)* %3, <2 x float> <float 1.000000e+00, float 2.000000e+00>) |
| 28 | store <4 x float> %4, <4 x float> addrspace(1)* %2, align 16 |
| 29 | ret void |
| 30 | } |
| 31 | |
| 32 | declare %opencl.sampler_t addrspace(2)* @_Z25clspv.sampler_var_literal(i32, i32, i32) |
| 33 | |
| 34 | declare %opencl.image2d_ro_t.float.sampled addrspace(1)* @_Z14clspv.resource.0(i32, i32, i32, i32, i32, i32) |
| 35 | |
| 36 | declare { [0 x <4 x float>] } addrspace(1)* @_Z14clspv.resource.1(i32, i32, i32, i32, i32, i32) |
| 37 | |
| 38 | !clspv.descriptor.index = !{!4} |
| 39 | |
| 40 | !4 = !{i32 2} |