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

[HLSL] SPIRV_Cross_VertexInfo is not relieble #2032

Closed
Try opened this issue Oct 1, 2022 · 0 comments · Fixed by #2035
Closed

[HLSL] SPIRV_Cross_VertexInfo is not relieble #2032

Try opened this issue Oct 1, 2022 · 0 comments · Fixed by #2035

Comments

@Try
Copy link
Contributor

Try commented Oct 1, 2022

Face issue with my pet-game-engine:

  1. spirv-cross emits code, like:
cbuffer SPIRV_Cross_VertexInfo
{
   int SPIRV_Cross_BaseVertex;
   int SPIRV_Cross_BaseInstance; 
};     
  1. Since no particular binding register is specified, it gonna be assigned automatically by DXIL.
    Normally it's lowest positive value that is unused by other cbuffers
  2. Register that assigned automatically may overlap with some else cbuffer in fragment shader, causing link/runtime issues.

Problem is somewhat outside of spirv-cross scope, and apparently there is no perfect solution to it. My current idea is to add new parameter CompilerHLSL::Options::vertexInfoRegister, that can be provided by game engine to specify exact register.
(Note: engine also can't provide sensible value, but can specify "magic" value like 255 or something)
What do you think about such solution? Thanks!

UPD:
Need to double check, but push-constant possible can have same issue

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 a pull request may close this issue.

1 participant