-
Notifications
You must be signed in to change notification settings - Fork 15
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
Advanced vertex format support #54
Comments
I added a draft PR to illustrate the idea, let me know if this fits the goals of Screen 13 or not. The logic is basically inspired by similar changes and a proc-macro I contributed to Vulkano recently, relevant code: However I simplified the implementation and reduced the amount of types involved, I do think this would fit Screen 13 as I believe this is a nice escape hatch, when more control of the vertex input state is required. Take the chosen type names with a grain of salt, the draft was thrown together in a couple of minutes, name proposals appreciated. |
This change definitely fits the goals of the crate; I want to deliver something that allows easy use of the common Vulkan use-cases and also allows full access to all the options when needed. This is one area which falls short currently, because users cannot specify some types at all, for instance This area shares a similar design issue to sampler selection; I'm not really happy with the
This naming system came from layout(location = 0) in vec3 position_ibind0_r16g16b16_unorm; For both issues, there are super common values that most people will use and learning some Screen-13-specific language is not what they have in mind, so a system where sane defaults are used and then the I'll add comments and suggest code changes on #56 - although it will probably over the next week. Thank you again for this! |
Perfect, that gives me some time to polish up the PR and think some more about it. As it was honestly a very rough first draft. I just wanted to get the idea out of my head. I agree with you that samplers suffer from similar limitations right now. |
This is more of a thought and feature request. Generally the inferred attribute layout is enough for my personal needs, but might be limited for more advanced use-cases other users come up with.
GLSL does not allow specifying the input precision or format precisely, so this has to be done on the Vulkan-side.
A simple example would be a user wanting to leverage
R16G16B16_SNORM
format to reduce the size of normals transferred or maybe requiring double precision for some input.My proposal to solve this would be to add an additional field to
GraphicPipelineInfo
, that is an enum defaulting toAttributeLayout::Automatic
(name tbd maybeVertexDescription
is better 🤷), but this enum has a second optionAttributeLayout::Explicit(...)
, which would allow specifying formats, input rate etc precisely (so not relying on defaults or naming conventions in the shader).The text was updated successfully, but these errors were encountered: