forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DirectX] Add stub PSV0 section (llvm#96712)
Direct3D requires a PSV0 section to be present in the DXContainer in order to be able to load and use the shader. This change adds a minimal stub PSV0, with some hard-coded values, that are just enough to unblock loading into Direct3D. Contributes to #90129
- Loading branch information
1 parent
01ac534
commit ef20d5b
Showing
3 changed files
with
75 additions
and
1 deletion.
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
41 changes: 41 additions & 0 deletions
41
llvm/test/CodeGen/DirectX/ContainerData/PipelineStateValidation.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,41 @@ | ||
; RUN: opt %s -dxil-embed -dxil-globals -S -o - | FileCheck %s | ||
; RUN: llc %s --filetype=obj -o - | obj2yaml | FileCheck %s --check-prefix=DXC | ||
target triple = "dxil-unknown-shadermodel6.0-compute" | ||
|
||
; CHECK: @dx.psv0 = private constant [76 x i8] c"{{.*}}", section "PSV0", align 4 | ||
|
||
define void @main() #0 { | ||
entry: | ||
ret void | ||
} | ||
|
||
attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" } | ||
|
||
!dx.valver = !{!0} | ||
|
||
!0 = !{i32 1, i32 7} | ||
|
||
; DXC: - Name: PSV0 | ||
; DXC: Size: 76 | ||
; DXC: PSVInfo: | ||
; DXC: Version: 3 | ||
; DXC: ShaderStage: 5 | ||
; DXC: MinimumWaveLaneCount: 0 | ||
; DXC: MaximumWaveLaneCount: 4294967295 | ||
; DXC: UsesViewID: 0 | ||
; DXC: SigInputVectors: 0 | ||
; DXC: SigOutputVectors: [ 0, 0, 0, 0 ] | ||
; DXC: NumThreadsX: 1 | ||
; DXC: NumThreadsY: 1 | ||
; DXC: NumThreadsZ: 1 | ||
; DXC: EntryName: main | ||
; DXC: ResourceStride: 24 | ||
; DXC: Resources: [] | ||
; DXC: SigInputElements: [] | ||
; DXC: SigOutputElements: [] | ||
; DXC: SigPatchOrPrimElements: [] | ||
; DXC: InputOutputMap: | ||
; DXC: - [ ] | ||
; DXC: - [ ] | ||
; DXC: - [ ] | ||
; DXC: - [ ] |