Skip to content

pack-optimized issue with domain shader #3362

@turanszkij

Description

@turanszkij

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crash

    Type

    No type

    Projects

    Status

    Triaged

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions