-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Weird drawing behavior with G4onG5 with Vulkan backend #830
Comments
It happens here too (amd + windows). It looks like you have to put these uniform constants in the for loop to make it work as intended:
The constants are written to a vertexConstantBuffer and fragmentConstantBuffer. Kinc/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h Lines 35 to 36 in 6c012b7
Each call to kinc_g4_draw_indexed_vertices on G4onG5 uses a offset (constantBufferIndex*constantBufferSize) from these buffers and they are then linked with a g5 command. Kinc/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h Lines 229 to 237 in 6c012b7
Kinc/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h Lines 171 to 172 in 6c012b7
Kinc/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/commandlist.c.h Lines 799 to 805 in 6c012b7
The command list is then executed every 100 draw calls, on a vertex_buffer change, kinc_g4_start() or on kinc_g4_end(). Kinc/Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h Lines 177 to 182 in 6c012b7
So at the moment your 1st instance uses all constants and the rest are only using off_loc and rot_loc. Edit: |
Describe the bug
Drawing the same indexed vertices multiple times with some uniforms set only once per pipeline/frame and other uniforms set differently for each draw call, the resulting render looks strange (out of sync, appears to be drawn over the span of multiple frames).
using G4onG5 with Vulkan backend
rec-2023-12-03--15-17-42.mp4
using OpenGL backend
rec-2023-12-03--15-22-18.mp4
To Reproduce
A repro repo can be found here: weird-vulkan-behavior
Expected behavior
See the video where the OpenGL backend is being used.
Execution Environment:
Running with Vulkan validation layers enabled.
The text was updated successfully, but these errors were encountered: