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

[naga hlsl-out] Generate SV_StartVertexLocation and SV_StartInstanceLocation when supported to handle non-zero base_instance/vertex. #6589

Open
Elabajaba opened this issue Nov 22, 2024 · 0 comments
Labels
api: dx12 Issues with DX12 or DXGI type: enhancement New feature or request

Comments

@Elabajaba
Copy link
Contributor

Elabajaba commented Nov 22, 2024

Is your feature request related to a problem? Please describe.
DX12/HLSL is dumb and always gives you 0 in the shader for base_vertex/base_instance no matter what value you set it to in the draw call. Microsoft finally added 2 new keywords in shader model 6.8 to get the offset base_vertex/base_instance values.

Describe the solution you'd like
Microsoft finally added 2 new keywords to get the start/base vertex/instance location in shader model 6.8, so we should use those and disable the shader param injection workaround in wgpu if SM 6.8+ is in use.
https://github.com/microsoft/DirectX-Specs/blob/master/d3d/HLSL_ShaderModel6_8.md#extended-command-information

Additional context
#2471

@teoxoy teoxoy added type: enhancement New feature or request api: dx12 Issues with DX12 or DXGI labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dx12 Issues with DX12 or DXGI type: enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants