Debian Codegraph @

clang/test/CodeGenHLSL/vk-features/vk.pushconstant.layout.hlsl

raw
1 // RUN: %clang_cc1 -triple spirv-pc-vulkan-compute -x hlsl -emit-llvm -finclude-default-header -disable-llvm-passes -o - %s | FileCheck %s
2
3 struct T {
4 float2 f1[3];
5 // FIXME(): matrix support.
6 // column_major float3x2 f2[2];
7 // row_major int3x2 f4[2];
8 // row_major float3x2 f3[2];
9 };
10 // %struct.T = type { [3 x <2 x float>] }
11
12 struct S {
13 float f1;
14 float3 f2;
15 T f4;
16 // FIXME(): matrix support.
17 // row_major int2x3 f5;
18 // row_major float2x3 f3;
19 };
20 // %struct.S = type <{ float, <3 x float>, %struct.T }>
21
22 [[vk::push_constant]]
23 S pcs;
24 // CHECK: @pcs = external hidden addrspace(13) externally_initialized global %struct.S, align 1
25
26 [numthreads(1, 1, 1)]
27 void main() {
28 float a = pcs.f1;
29 // CHECK: %[[#TMP:]] = load float, ptr addrspace(13) @pcs, align 1
30 // CHECK: store float %[[#TMP]], ptr %a, align 4
31 }