-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cooper Partin
committed
Nov 5, 2024
1 parent
0d820cc
commit 931a684
Showing
6 changed files
with
115 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s | ||
|
||
target triple = "dxil-pc-shadermodel6.3-compute" | ||
|
||
@G = external constant <4 x float>, align 4 | ||
|
||
define void @test_bufferflags() { | ||
|
||
; RWByteAddressBuffer Buf : register(u8, space1) | ||
%uav0 = call target("dx.RawBuffer", i8, 1, 0) | ||
@llvm.dx.handle.fromBinding.tdx.RawBuffer_i8_0_0t( | ||
i32 1, i32 8, i32 1, i32 0, i1 false) | ||
|
||
ret void | ||
} | ||
|
||
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) } | ||
|
||
; CHECK: ; Shader Flags Value: 0x00000010 | ||
; CHECK: ; Note: shader requires additional functionality: | ||
; CHECK-NEXT: ; Note: extra DXIL module flags: | ||
; CHECK-NEXT: ; D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS | ||
; CHECK-NEXT: {{^;$}} |
24 changes: 24 additions & 0 deletions
24
llvm/test/CodeGen/DirectX/ShaderFlags/rwstructuredbuffer.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s | ||
|
||
target triple = "dxil-pc-shadermodel6.7-library" | ||
|
||
@G = external constant <4 x float>, align 4 | ||
|
||
define void @test_bufferflags() { | ||
|
||
; struct S { float4 a; uint4 b; }; | ||
; RWStructuredBuffer<S> Buf : register(u2, space4) | ||
%struct0 = call target("dx.RawBuffer", {<4 x float>, <4 x i32>}, 1, 0) | ||
@llvm.dx.handle.fromBinding.tdx.RawBuffer_sl_v4f32v4i32s_0_0t( | ||
i32 4, i32 2, i32 1, i32 10, i1 true) | ||
|
||
ret void | ||
} | ||
|
||
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) } | ||
|
||
; CHECK: ; Shader Flags Value: 0x00000010 | ||
; CHECK: ; Note: shader requires additional functionality: | ||
; CHECK-NEXT: ; Note: extra DXIL module flags: | ||
; CHECK-NEXT: ; D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS | ||
; CHECK-NEXT: {{^;$}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s | ||
|
||
target triple = "dxil-pc-shadermodel6.7-library" | ||
|
||
@G = external constant <4 x float>, align 4 | ||
|
||
define void @test_bufferflags() { | ||
|
||
; struct S { float4 a; uint4 b; }; | ||
; StructuredBuffer<S> Buf : register(t2, space4) | ||
%struct0 = call target("dx.RawBuffer", {<4 x float>, <4 x i32>}, 0, 0) | ||
@llvm.dx.handle.fromBinding.tdx.RawBuffer_sl_v4f32v4i32s_0_0t( | ||
i32 4, i32 2, i32 1, i32 10, i1 true) | ||
|
||
ret void | ||
} | ||
|
||
attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) } | ||
|
||
; CHECK: ; Shader Flags Value: 0x00000010 | ||
; CHECK: ; Note: shader requires additional functionality: | ||
; CHECK-NEXT: ; Note: extra DXIL module flags: | ||
; CHECK-NEXT: ; D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS | ||
; CHECK-NEXT: {{^;$}} |