microsoft / microsoft/DirectXShaderCompiler

Missing validation error on DS compilation with no patch constant signature

Open
#6,629 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug validation
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
D3D12 shader linkages require identical declarations of the patch constant signature between HS and DS. Since HS must output tessellation levels, DS must therefore input them. FXC had such an error:

error X3502: ds_5_0 tessfactor inputs missing

Steps to Reproduce

[domain("tri")]
float4 DSMain(float4 pos : POS) : SV_Position
{
	return pos;
}

Compile with FXC target ds_5_0 and you get error X3502. DXC succeeds. Attempting to use such a shader results in a D3D12 PSO creation failure (E_FAIL) with no debug layer error message (D3D bug 50951962 is tracking this missing error message).

See https://godbolt.org/z/5bs15vx4s for DXC on trunk, and https://shader-playground.timjones.io/3b46dc2f059f0b0611dcf44c264ccaab for FXC.

Environment

  • DXC version: dxc(private) 1.8.0.10001 (main, ff623f8a)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by compiling the provided domain-shader snippet with the DXC version described and compare its behavior with FXC. Trace the diagnostic path for domain-shader validation and determine where missing tessellation-level inputs should be rejected. Done means DXC reports a validation error for this case, with coverage for the regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.