blob: 71478ba2a97e3b8c82de6c30e5d96f88627c5a9b [file] [log] [blame]
// RUN: clspv %s -o %t.spv -no-dra -no-inline-single
// RUN: spirv-dis -o %t2.spvasm %t.spv
// RUN: FileCheck %s < %t2.spvasm
// RUN: spirv-val --target-env vulkan1.0 %t.spv
// Passing SSBO to function call requires VariablePointersStorageBuffer.
// SSBO args do not require memory object declarations.
int bar(global int* x) { return *x; }
kernel void foo(global int* in, global int* out) {
*out = bar(in + 1);
}
// CHECK-NOT: OpCapability VariablePointers
// CHECK: OpCapability VariablePointersStorageBuffer
// CHECK-NOT: OpCapability VariablePointers
// CHECK: OpExtension "SPV_KHR_variable_pointers"
// CHECK: [[uint:%[a-zA-Z0-9_]+]] = OpTypeInt 32 0
// CHECK: [[ptr:%[a-zA-Z0-9_]+]] = OpTypePointer StorageBuffer [[uint]]
// CHECK: [[uint_0:%[a-zA-Z0-9_]+]] = OpConstant [[uint]] 0
// CHECK: [[uint_1:%[a-zA-Z0-9_]+]] = OpConstant [[uint]] 1
// CHECK: [[gep:%[a-zA-Z0-9_]+]] = OpAccessChain [[ptr]] {{.*}} [[uint_0]] [[uint_1]]
// CHECK-NEXT: OpFunctionCall [[uint]] {{.*}} [[gep]]