Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

[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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants