Make animate_shader example work on WASM#4814
Closed
johanhelsing wants to merge 2 commits intobevyengine:mainfrom
Closed
Make animate_shader example work on WASM#4814johanhelsing wants to merge 2 commits intobevyengine:mainfrom
johanhelsing wants to merge 2 commits intobevyengine:mainfrom
Conversation
Contributor
Author
Previously, it would draw nothing and complain with the following console warnings: Firefox: WebGL warning: drawElementsInstanced: Buffer for uniform block is smaller than UNIFORM_BLOCK_DATA_SIZE Chrome: [.WebGL-00003B081B72A300] GL_INVALID_OPERATION: It is undefined behaviour to use a uniform buffer that is too small. Issue: bevyengine#4813
Use ShaderType/UniformBuffer
1a15f35 to
67aad46
Compare
Contributor
Author
|
Rebased after encase migration and the fix for wasm panicking. Ready for review now :) |
Contributor
Author
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.
Previously, it would draw nothing and complain with the following
console warnings:
Firefox:
Chrome:
Objective
Fixes: #4813
Solution
I looked at some other code regarding uniforms that worked on wasm and tried to do the same thing (Derive AsStd140 and usestd140_size_static).UniformBufferandShaderTypeMy understanding of how uniform buffers work is a bit lacking, so please review carefully ;)
Changelog
animate_shaderexample now works on wasm