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

[hlsl-out] Use the namer to sanitise entrypoint input/output struct names #2001

Merged
merged 2 commits into from
Jul 6, 2022

Conversation

expenses
Copy link
Contributor

@expenses expenses commented Jul 6, 2022

This is especially relevant for shaders generated by rust-gpu.

Before:

struct VertexOutput_single_view::vertex_skybox_mirrored {
    float3 member_1 : LOC0;
    float4 member : SV_Position;
};

After:

struct VertexOutput_single_viewvertex_skybox_mirrored {
    float3 member_1 : LOC0;
    float4 member : SV_Position;
};

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks fine, my only comment is do we want to document how we sanitize names somewhere, as users need to be able to match the names perfectly in the entry point declarations in wgpu

@expenses
Copy link
Contributor Author

expenses commented Jul 6, 2022

Code looks fine, my only comment is do we want to document how we sanitize names somewhere, as users need to be able to match the names perfectly in the entry point declarations in wgpu

IMO I should be able to able to tell wgpu to create a pipeline with a foo::bar shader entry point, even if the name has been sanitized in the shader. I guess the best way to accomplish this is to expose a naga function that sanitized the entry points for lookups.

@expenses
Copy link
Contributor Author

expenses commented Jul 6, 2022

I'll look into it when I get closer to having my code work on DX12

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