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

Compute correct layout for arrays of opaque types in Vulkan #84

Closed
tangent-vector opened this issue Jul 13, 2017 · 0 comments
Closed

Compute correct layout for arrays of opaque types in Vulkan #84

tangent-vector opened this issue Jul 13, 2017 · 0 comments

Comments

@tangent-vector
Copy link
Contributor

HLSL and OpenGL GLSL are consistent in that a declaration like:

Texture2D t[4]; // HLSL
sampler2D t[4]; // OpenGL GLSL

consumes 4 registers/bindings: one for each array element.

Vulkan seems to follow a different rule, where the entire array gets a single binding. Right now we do not implement this behavior correctly.

tangent-vector added a commit to tangent-vector/slang that referenced this issue Jul 13, 2017
Fixes shader-slang#84

- When computing resource usage for an array type, don't multiply the resource usage of the element type by the element count foor descriptor-table-slot resources.

- When reporting the "stride" of an array type through reflection, report the stride for descriptor table slots as zero, always.
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

No branches or pull requests

1 participant