Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Add missing resources types to ShaderResources. #1

Conversation

WhyAreAllTheseTaken
Copy link

Updates to SPIRV-Cross have introduced new types to ShaderResources that are not currently available in this crate. One of which was gl_plain_uniforms which meant that GLSL uniforms that were not declared in a UBO could not be accessed or renamed. See KhronosGroup/SPIRV-Cross#2190 for details about that issue.

This pull request adds the missing fields and updates the wrapper code to set them. This also involved updating the bindings to use the new wrapper fields. The fields added are acceleration_structures, gl_plain_uniforms and shader_record_buffers. Due to this, ShaderResources now contains all fields from it's corresponding structure in SPIRV-Cross except for the builtin values.

As this added new publicly accessible fields to ShaderResources, this introduces a major change for semantic version compatibility. However, this pull request does not require that the dependency on SPIRV-Cross be updated as the fields were already included in the version of SPIRV-Cross that is currently in use by this crate.

I decided not to contribute this to the original spirv_cross crate as that crate was so outdated and depended on an older version of SPIRV-Cross that did not have the fields I wanted to use. Instead, I though that I would contribute it here in case it was useful as this crate seems to be more up-to-date.

ShaderResources did not include some resource types that were included
in newer versions of SPIRV-Cross. One of which was `gl_plain_uniforms`
which meant that GLSL uniforms that were not declared in a UBO could
not be accessed or renamed. See KhronosGroup/SPIRV-Cross#2190 for
details about the issue.
`shader_record_buffers` was not assigned to which caused undefined
behaviour on access.
@chyyran
Copy link
Owner

chyyran commented Jul 9, 2024

Happy to take these changes, but these bindings are meant to be used with librashader and have to be kept in lockstep with that project. Will merge when I get the chance to update librashader in accordance with any breakages.

@chyyran chyyran merged commit 7e59bfe into chyyran:update-spirv-cross Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants