-
Notifications
You must be signed in to change notification settings - Fork 570
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: binding start offset feature #2340
Comments
What do you mean here, do you want to offset packoffset() (c0), or register(b#)? Of the latter, you can use the resource binding APIs to achieve that. Random resource shifts is jarring and not supported. You can override the bindings in many different ways. |
Yeah, I was about packoffset(c#) starts from some arbitrary value and register(b#, space#) to start from some value and was thinking about this feature or how to do this if already implemed features |
You want to look at CompilerHLSL::add_hlsl_resource_binding. It can override register/space as needed. |
@HansKristian-Work there is another thing with generating actual hlsl code. It is similar to my initial issue, but different, and I think this should be a bug. For example, I have this piece of glsl shader bindings defines:
And the issue is that it will translate to something like this:
The issue is that after translating glsl to hlsl, there will be overlapping registers and I wont be able to create a pipeline state. If I have a register, which is actually an array of samplers (like GBuffer in my code), then, the bindings after that should come like this:
Or it shpuld just generate Texture2DArray, but then without binding offset |
Hi, I have small user experience issue, not really bug or anything. I am interested if spirv-cross have a feature so that when it cross compile from spv to hlsl, it would start, for example, CBVs not from 0, but from another user specified value.
For example, right now, I have this cbuffer, generated from spirv:
And I want to know if it spirv-cross could generate the bindings for specific resource type to be started from another value(for example, starting from 1) and not from zero
The text was updated successfully, but these errors were encountered: