Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

69 lines
2.7 KiB
HLSL

// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
// RUN: %clang_cc1 -finclude-default-header -triple spirv-vulkan-library %s \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
// Scenario 1: Basic Padding (No row crossing).
struct Basic {
float3 a;
float b;
};
// CHECK-DAG: %Basic = type <{ <3 x float>, float }>
// CHECK-DXIL-DAG: %"class.hlsl::ConstantBuffer" = type { target("dx.CBuffer", %Basic) }
// CHECK-SPIRV-DAG: %"class.hlsl::ConstantBuffer" = type { target("spirv.VulkanBuffer", %Basic, 2, 0) }
ConstantBuffer<Basic> cb_basic;
// Scenario 2: Row Boundary Crossing.
struct RowCrossing {
float2 a;
float3 b;
};
// CHECK-DXIL-DAG: %RowCrossing = type <{ <2 x float>, target("dx.Padding", 8), <3 x float> }>
// CHECK-SPIRV-DAG: %RowCrossing = type <{ <2 x float>, target("spirv.Padding", 8), <3 x float> }>
ConstantBuffer<RowCrossing> cb_row_crossing;
// Scenario 3: Arrays.
struct ArrayPadding {
float a[2];
float b;
};
// CHECK-DXIL-DAG: %ArrayPadding = type <{ <{ [1 x <{ float, target("dx.Padding", 12) }>], float }>, float }>
// CHECK-SPIRV-DAG: %ArrayPadding = type <{ <{ [1 x <{ float, target("spirv.Padding", 12) }>], float }>, float }>
ConstantBuffer<ArrayPadding> cb_array;
// Scenario 4: Nested Structs.
struct Inner {
float a;
};
struct Outer {
Inner i;
float3 b;
};
// CHECK-DAG: %Inner = type <{ float }>
// CHECK-DAG: %Outer = type <{ %Inner, <3 x float> }>
ConstantBuffer<Outer> cb_nested;
[numthreads(1,1,1)]
void main() {
// Scenario 1
// CHECK-LABEL: define {{.*}} void @_Z4mainv()
// CHECK: %[[CB_BASIC:.*]] = call {{.*}} ptr addrspace({{.*}}) @_ZNK4hlsl14ConstantBufferI5BasicEcvRU{{.*}}S1_Ev
// CHECK: getelementptr inbounds nuw %Basic, ptr addrspace({{.*}}) %[[CB_BASIC]], i32 0, i32 1
float f1 = cb_basic.b;
// Scenario 2
// CHECK: %[[CB_ROW:.*]] = call {{.*}} ptr addrspace({{.*}}) @_ZNK4hlsl14ConstantBufferI11RowCrossingEcvRU{{.*}}S1_Ev
// CHECK: getelementptr inbounds nuw %RowCrossing, ptr addrspace({{.*}}) %[[CB_ROW]], i32 0, i32 2
float3 f2 = cb_row_crossing.b;
// Scenario 3
// CHECK: %[[CB_ARRAY:.*]] = call {{.*}} ptr addrspace({{.*}}) @_ZNK4hlsl14ConstantBufferI12ArrayPaddingEcvRU{{.*}}S1_Ev
// CHECK: getelementptr inbounds nuw %ArrayPadding, ptr addrspace({{.*}}) %[[CB_ARRAY]], i32 0, i32 1
float f3 = cb_array.b;
// Scenario 4
// CHECK: %[[CB_NESTED:.*]] = call {{.*}} ptr addrspace({{.*}}) @_ZNK4hlsl14ConstantBufferI5OuterEcvRU{{.*}}S1_Ev
// CHECK: getelementptr inbounds nuw %Outer, ptr addrspace({{.*}}) %[[CB_NESTED]], i32 0, i32 1
float3 f4 = cb_nested.b;
}