-
Notifications
You must be signed in to change notification settings - Fork 63
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
sokol-shdc doesn't generate ATTR macros #141
Comments
The list in the comment is generated from the inputs array directly on the vertex shader, so that seems to be correct: sokol-tools/src/shdc/generators/generator.cc Lines 95 to 99 in 9300010
...but the actual macro definitions are generated from a 'unique list' which is supposed to contain all unique vertex shader inputs over all vertex shader snippets: sokol-tools/src/shdc/generators/generator.cc Lines 147 to 151 in 9300010
...so the problem must be in the merge_vs_inputs function here: sokol-tools/src/shdc/reflection.cc Lines 287 to 308 in 9300010
I'll try to investigate further tomorrow. |
It has worked with metal. I don't target HLSL. For what it's worth, this is how I was providing the data on the CPU side: sg_make_pipeline(&(sg_pipeline_desc){
// lines removed for clarity
.layout.attrs = {
[ATTR_layer_vs_aUVRotateScale+0] = {
.offset = offsetof(DrawInfo,uvRotateScaleMatrix),
.format = SG_VERTEXFORMAT_FLOAT2,
.buffer_index = 1,
},
[ATTR_layer_vs_aUVRotateScale+1] = {
.offset = offsetof(DrawInfo,uvRotateScaleMatrix) +sizeof(float)*2,
.format = SG_VERTEXFORMAT_FLOAT2,
.buffer_index = 1,
},
}
}); |
Ah interesting, that should work yeah. Ok I'll see if I can restore the old behaviour. |
This should now be fixed via PR #142. Binaries will be updated after this CI pipeline goes green: https://github.com/floooh/sokol-tools/actions/runs/10373572552 Please let me know if it works for you :) |
I'm using the binary from here (version numbers would be great!) to compile my shaders and it isn't ouputting
ATTR_
macros for all the attributes. In the last version of sokol-shdc that I used (fromfloooh/sokol-tools-bin/
commit 8573f3ccbb2a8d05ff5a97295f8d2c7bdc2f6065), it would generate all the macrosrun the following command on the below glsl to reproduce the issue.
click to expand shaders.glsl source
You'll notice that the resulting
shaders.h
file doesn't have a definition for all the attributes it lists in the comments:comment:
macros:
The text was updated successfully, but these errors were encountered: