Comments (1)
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:
kinc_g4_set_matrix4(mvp_loc, &mvp_mat);
kinc_g4_set_matrix4(v_loc, &v_mat);
kinc_g4_set_floats(lightPos_loc, (float*)&light_pos, 3);
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.
1st cube:
2nd cube:
Edit:
The cubes eventually appear because each frame the mvp and v uniform constants are set on a different offset location
1st cube now has offset 344064:
from kinc.
Related Issues (20)
- HDR and wide color range output setup.
- Vulkan: Descriptor Set Cache
- Vulkan: multiple render targets broken
- D3D12 crash when hiding/showing window multiple times HOT 6
- Screen tearing / Incomplete frames when instanced rendering (Vulkan on Android device (FP3)) HOT 1
- Can't compile Krom
- Flickering/Possible Sync issue when reusing index buffer on Metal
- Rendertarget defaults to magenta in Metal (but is transparent on HTML5) HOT 3
- Keyboard input not working on Endeavour OS (Arch Linux) HOT 4
- Compute for Vulkan is missing
- Option to disable features HOT 1
- Ability to use Clang to compile for Windows HOT 6
- Kinc can't use a 3d image with compute shaders HOT 1
- Empty example doesn't work on X11 + Vulkan HOT 7
- kinc_g4_texture_init_*() vulkan errors HOT 3
- Can't bind more than one image in compute shaders. HOT 12
- TextureFormat RGBA32 isn't working with compute. HOT 1
- Rendertarget samples broken with G4onG5 HOT 3
- Cross compilation from Linux to Windows HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kinc.