Skip to content

[DirectX][SPIRV] Allow configuration of instanced draw parameters - #1510

Open
jzakharovnv wants to merge 1 commit into
llvm:mainfrom
jzakharovnv:instance_draw_params
Open

[DirectX][SPIRV] Allow configuration of instanced draw parameters#1510
jzakharovnv wants to merge 1 commit into
llvm:mainfrom
jzakharovnv:instance_draw_params

Conversation

@jzakharovnv

@jzakharovnv jzakharovnv commented Sep 9, 2026

Copy link
Copy Markdown

Fixes #1444 and hlsl wg issue

Testing for SV_InstanceID

Marked xfail until clang SV_InstanceID implementation and clang SV refactor land

@dnovillo @pow2clk

Assisted-by: LLM

@dnovillo dnovillo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these tests. I'm not very experienced with OTS, so I may have missed a few things in my review.

Comment thread lib/Support/Pipeline.cpp
"pipeline. Only allowed on a TraditionalRaster pipeline.");
if (DispatchParameters.InstanceCount != 1 ||
DispatchParameters.FirstVertex != 0 ||
DispatchParameters.FirstInstance != 0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RT dispatch does not consume these fields. Could you reject nondefault InstanceCount, FirstVertex, and FirstInstance values in the RayTracing case and add a parsing test that verifies the error?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let me add this too with the next commit

Entry: main
DispatchParameters:
VertexCount: 3
InstanceCount: 4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FirstVertex and FirstInstance do not seem covered. Could you add a test with non-zero FirstVertex and FirstInstance? When reading back start vertex location and start instance location, SV_InstanceID should remain zero-based.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, let me add testing for those in the following days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DirectX][SPRIV] Allow configuration of instanced draw parameters

3 participants