Make the StandardMaterial bindless index table have a fixed size regardless of the features that are enabled.#18771
Merged
alice-i-cecile merged 16 commits intobevyengine:mainfrom Apr 9, 2025
Merged
Conversation
PR bevyengine#17898 disabled bindless support for `ExtendedMaterial`. This commit adds it back. It also adds a new example, `extended_material_bindless`, showing how to use it.
They were sized based on the total number of resources (base + extended), which was incorrect. They should be based on the binding range.
Contributor
Author
|
The only commit that's unique to this PR is 31db8e2. |
regardless of the features that are enabled. Due to the preprocessor usage in the shader, different combinations of features could cause the fields of `StandardMaterialBindings` to shift around. In certain cases, this could cause them to not line up with the bindings specified in `StandardMaterial`. This resulted in bevyengine#18104. This commit fixes the issue by making `StandardMaterialBindings` have a fixed size. On the CPU side, it uses the `#[bindless(index_table(range(M..N)))]` feature I added to `AsBindGroup` in bevyengine#18025 to do so. Thus this patch has a dependency on bevyengine#18025. Closes bevyengine#18104.
Contributor
|
not tested, but from the comments on the issue: is the |
alice-i-cecile
approved these changes
Apr 9, 2025
Contributor
Author
|
@robtfm It's necessary because without that attribute the index table that |
mockersf
pushed a commit
that referenced
this pull request
Apr 9, 2025
…gardless of the features that are enabled. (#18771) Due to the preprocessor usage in the shader, different combinations of features could cause the fields of `StandardMaterialBindings` to shift around. In certain cases, this could cause them to not line up with the bindings specified in `StandardMaterial`. This resulted in #18104. This commit fixes the issue by making `StandardMaterialBindings` have a fixed size. On the CPU side, it uses the `#[bindless(index_table(range(M..N)))]` feature I added to `AsBindGroup` in #18025 to do so. Thus this patch has a dependency on #18025. Closes #18104. --------- Co-authored-by: Robert Swain <robert.swain@gmail.com>
jf908
pushed a commit
to jf908/bevy
that referenced
this pull request
May 12, 2025
…gardless of the features that are enabled. (bevyengine#18771) Due to the preprocessor usage in the shader, different combinations of features could cause the fields of `StandardMaterialBindings` to shift around. In certain cases, this could cause them to not line up with the bindings specified in `StandardMaterial`. This resulted in bevyengine#18104. This commit fixes the issue by making `StandardMaterialBindings` have a fixed size. On the CPU side, it uses the `#[bindless(index_table(range(M..N)))]` feature I added to `AsBindGroup` in bevyengine#18025 to do so. Thus this patch has a dependency on bevyengine#18025. Closes bevyengine#18104. --------- Co-authored-by: Robert Swain <robert.swain@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to the preprocessor usage in the shader, different combinations of features could cause the fields of
StandardMaterialBindingsto shift around. In certain cases, this could cause them to not line up with the bindings specified inStandardMaterial. This resulted in #18104.This commit fixes the issue by making
StandardMaterialBindingshave a fixed size. On the CPU side, it uses the#[bindless(index_table(range(M..N)))]feature I added toAsBindGroupin #18025 to do so. Thus this patch has a dependency on #18025.Closes #18104.