Skip to content
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

Adding the type to Vertex Attributes in the bare yaml reflection #148

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

Interrupt
Copy link
Contributor

I don't know if this would be useful, but someone in the #gamedev channel on the Zig discord was talking about wanting to get the type of a vertex attribute and I saw that it wasn't being included yet, this adds some type info to the StageAttr struct and outputs the type in generated yaml files just to start.

@floooh
Copy link
Owner

floooh commented Sep 5, 2024

Might be useful for some people, but note that it isn't required that the vertex format in the pipeline object exactly matches the shader input, since the vertex fixed function pipeline does a limited amount of conversions (e.g. packed formats like ubyte4n will be unpacked into vec4, vec2/3/4 expanded (and afaik also clipped) as needed.

I'll have a quick look in the evening and will merge then.

@floooh
Copy link
Owner

floooh commented Sep 5, 2024

Doing a quick test on this now...

@floooh floooh merged commit c3c4dc9 into floooh:master Sep 5, 2024
3 checks passed
@floooh
Copy link
Owner

floooh commented Sep 5, 2024

Ok looks good and merged. I did one minor change: remove the const from the get_type_for_attribute() return type (since the return type is a value the constness is redundant).

Thanks for the PR!

@floooh
Copy link
Owner

floooh commented Sep 5, 2024

Binaries will be uptodate after this CI pipeline goes green: https://github.com/floooh/sokol-tools/actions/runs/10724881064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants