Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pack-optimized issue with domain shader #3362

Open
turanszkij opened this issue Jan 19, 2021 · 1 comment
Open

pack-optimized issue with domain shader #3362

turanszkij opened this issue Jan 19, 2021 · 1 comment
Labels
bug Bug, regression, crash
Milestone

Comments

@turanszkij
Copy link

turanszkij commented Jan 19, 2021

Hi,

I am having an issue with a domain shader which reorganizes input/output signature in an unexpected way when pack-optimized compiler flag is used. This in turn gives the following error in dx12 debug layer:

D3D12 ERROR: ID3D12Device::CreateGraphicsPipelineState: Domain Shader - Pixel Shader linkage error: Signatures between stages are incompatible. Semantic 'CLIP' of the input stage has a hardware register component mask that is not a subset of the output of the previous stage. [ STATE_CREATION ERROR #662: CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK]

The signature passed through from VS-HS-DS-PS stages is this (it's in a shared header, so it should be the same in all stages):

struct PixelInput
{
	float4 pos : SV_POSITION;
	float  clip : SV_ClipDistance0;
	float4 pre : PREVIOUSPOSITION;
	float3 nor : NORMAL;
};

In the disassembly I can see this when using pack-optimized for domain shader:

; Output signature:
;
; Name                 Index   Mask Register SysValue  Format   Used
; -------------------- ----- ------ -------- -------- ------- ------
; PREVIOUSPOSITION         0   xyzw        0     NONE   float   xyzw
; SV_Position              0   xyzw        1      POS   float   xyzw
; SV_ClipDistance          0      w        2  CLIPDST   float      w
; NORMAL                   0   xyz         2     NONE   float   xyz

And when NOT using pack-optimized:

; Output signature:
;
; Name                 Index   Mask Register SysValue  Format   Used
; -------------------- ----- ------ -------- -------- ------- ------
; SV_Position              0   xyzw        0      POS   float   xyzw
; SV_ClipDistance          0   x           1  CLIPDST   float   x
; PREVIOUSPOSITION         0   xyzw        2     NONE   float   xyzw
; NORMAL                   0   xyz         3     NONE   float   xyz

And the pixel shader input signature when using pack-optimized:

; Input signature:
;
; Name                 Index   Mask Register SysValue  Format   Used
; -------------------- ----- ------ -------- -------- ------- ------
; SV_Position              0   xyzw        0      POS   float   xy
; SV_ClipDistance          0   x           1  CLIPDST   float
; PREVIOUSPOSITION         0   xyzw        2     NONE   float   xy w

The pack-optimized version of domain output and pixel input doesn't match as you see, which is a problem.
I am attaching the dissassemblies and command line args.
disasm.zip

Best regards,
Janos

@llvm-beanz llvm-beanz added the needs-triage Awaiting triage label Jun 29, 2023
@damyanp damyanp added the bug Bug, regression, crash label Apr 11, 2024
@damyanp damyanp added this to the Dormant milestone Apr 11, 2024
@damyanp damyanp removed the needs-triage Awaiting triage label Apr 11, 2024
@damyanp
Copy link
Member

damyanp commented Apr 11, 2024

Unfortunately we are unlikely to be able to spend time on this now. However, we'd happily look at PR's addressing this issue.

@llvm-beanz llvm-beanz moved this to Triaged in HLSL Triage Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
Status: Triaged
Development

No branches or pull requests

3 participants