Justin Bogner 507373306e
[DirectX] Introduce dx.Padding type (#160957)
This introduces the `dx.Padding` type as an alternative to the
`dx.Layout` types that are currently used for cbuffers. Later, we'll
remove the `dx.Layout` types completely, but making the backend handle
either makes it easier to stage the necessary changes to get there.

See #147352 for details.
2025-10-16 12:31:54 -06:00

20 lines
600 B
LLVM

; Regression test for https://github.com/llvm/llvm-project/issues/128560 -
; check that cbuffers are populated correctly when there aren't any other kinds
; of resource.
; RUN: opt -S -passes=dxil-translate-metadata %s | FileCheck %s
target triple = "dxil-pc-shadermodel6.6-compute"
define void @cbuffer_is_only_binding() {
%cbuf = call target("dx.CBuffer", <{ float }>)
@llvm.dx.resource.handlefrombinding(i32 1, i32 8, i32 1, i32 0, ptr null)
; CHECK: %CBuffer = type { float }
ret void
}
; CHECK: @[[CB0:.*]] = external constant %CBuffer
; CHECK: !{i32 0, ptr @[[CB0]], !""