You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I use a uniform float array in a shader like this:
uniformfloat some_data[10];
I only get every 4th element from the float array I pass to the shader at runtime. It seems that the constant buffer used has an alignment requirement of 16 bytes.
To Reproduce
Passing in data to such a uniform float array (e.g. in my case using kinc_g4_set_floats) and either color debugging the data or using something like RenderDoc
Expected behavior
I would like to be able to access all the data with respective indexing to the original data.
Screenshots
This is how RenderDoc sees the data:
Execution Environment:
Host system (where you compile your code): Windows 10 x64
Target system (where you run your code): Windows 10 x64 D3D11
Using Kinc (273d3650) from C:\code\kraymarch\krink\Kinc
kfile found.
Creating Windows project files.
Compiling shader 1 of 14 (kr-painter-colored.frag).
Compiling shader 4 of 14 (kr-painter-image.vert).
Compiling shader 5 of 14 (kr-painter-sdf-circle.frag).
Compiling shader 6 of 14 (kr-painter-sdf-circle.vert).
Compiling shader 7 of 14 (kr-painter-sdf-line.frag).
Compiling shader 8 of 14 (kr-painter-sdf-line.vert).
Compiling shader 9 of 14 (kr-painter-sdf-rect.frag).
Compiling shader 10 of 14 (kr-painter-sdf-rect.vert).
Compiling shader 11 of 14 (kr-painter-text.frag).
Compiling shader 12 of 14 (kr-painter-text.vert).
Compiling shader 13 of 14 (g1.frag).
Compiling shader 14 of 14 (g1.vert).
Done.
Application output (if it runs): Not applicable
Additional context
I changed the type from float to vec4 and changed the logic of indexing, which resolves the issue for me. But I do believe this could be worth either documenting or handling internally in either Kinc or Krafix
The text was updated successfully, but these errors were encountered:
Describe the bug
When I use a uniform float array in a shader like this:
I only get every 4th element from the float array I pass to the shader at runtime. It seems that the constant buffer used has an alignment requirement of 16 bytes.
To Reproduce
Passing in data to such a uniform float array (e.g. in my case using
kinc_g4_set_floats
) and either color debugging the data or using something like RenderDocExpected behavior
I would like to be able to access all the data with respective indexing to the original data.
Screenshots
This is how RenderDoc sees the data:
Execution Environment:
Additional context
I changed the type from
float
tovec4
and changed the logic of indexing, which resolves the issue for me. But I do believe this could be worth either documenting or handling internally in either Kinc or KrafixThe text was updated successfully, but these errors were encountered: