-
Notifications
You must be signed in to change notification settings - Fork 33
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
Howto write shader input uniform value #127
Comments
Yeah, that code is updating the push constant. I'd recommend looking up the appropriate section in any vulkan tutorial as the C commands will map 1-1 with the functions in this library. I do think that some utilities to go from haskell records to the following would be an excellent fit for the utils library in this repo.
|
https://vulkan-tutorial.com/Uniform_buffers/Descriptor_layout_and_buffer, this page and the next one deal with using UBOs to pass data to shaders. Perhaps another valuable addition to this repo would be going through a page like that and making note of where the haskell code and c++ differ non-trivially. It should be a small diff
Also: if you use a UBO instead of push constants you should check out the VulkanMemoryAllocator library which makes allocating buffers a lot easier. |
Updating UBOs is really just You can inspect my playground for buffer code and descriptor setup, but I expect it to be overwhelming until you plow through the tutorial mentioned. Or you may cheat and try not become confused by reading my haskell rendition of it 😅 |
Btw, |
That is amazing, thank you for the details and tutorial links. That seems like valuable information for users of this library, perhaps it would be good enough to add those reference to the README, at least to help user like me who only know OpenGL. |
Would it be possible to add some documentations and/or a function to update an uniform value? If I understand correctly the code in
resize/Main.hs
, the Julia shader Frame uniform is updated using:I'm looking for replacing opengl (example here), and I am not sure what is the vulkan equivalent of
Graphics.GL.Core31.glUniform2f
.Thank you!
The text was updated successfully, but these errors were encountered: