-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Consider using push constants for camera data #1372
Labels
A-Rendering
Drawing game state to the screen
C-Code-Quality
A section of code that is hard to understand or change
Comments
Definitely worth considering! Random thoughts:
|
alice-i-cecile
added
A-Rendering
Drawing game state to the screen
C-Code-Quality
A section of code that is hard to understand or change
labels
Feb 17, 2021
On a second thought, using push constants require that we copy the camera data to the command buffer for every draw call. With a uniform buffer we'll be able to reuse this data every frame. I'm gonna close this for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-Rendering
Drawing game state to the screen
C-Code-Quality
A section of code that is hard to understand or change
Right now the
CameraNode
passes theViewProj
matrix to the shader by maintaining a uniform buffer that is hardcoded to be binded onlayout(set = 0, binding = 0)
. @cart explained in #1203 that the reason for this is thatGiven these, would it be a good idea to put the camera data in push constants, now that wgpu-rs has starting to support push constants?
Based on wgpu::Features, wgpu-rs supports push constants on all five native APIS: Vulkan, Metal, DX11, DX12, and OpenGL. But PUSH_CONSTANTS was not supported on web.
Using push constants for camera data addressed the problem mentioned above because push constants are, by its nature, a "per pass" setup.
The text was updated successfully, but these errors were encountered: