Debian Codegraph @

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

raw
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-compute -x hlsl -emit-llvm -finclude-default-header -disable-llvm-passes -o - %s | FileCheck %s
2
3 struct S {
4 uint value;
5 };
6 // CHECK: %struct.S = type { i32 }
7
8 // When targeting DXIL, the attribute is ignored, meaning this variable
9 // is part of the implicit cbuffer.
10 [[vk::push_constant]] S buffer;
11 // CHECK: @buffer = external hidden addrspace(2) global %struct.S, align 1
12
13 [numthreads(1, 1, 1)]
14 void main() {
15 uint32_t v = buffer.value;
16 // CHECK: %[[#REG:]] = load i32, ptr addrspace(2) @buffer, align 4
17 // CHECK: store i32 %[[#REG]], ptr %v, align 4
18 }