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

Reexport items needed to create a ShaderSource::Glsl #3559

Closed
yanchith opened this issue Mar 5, 2023 · 0 comments · Fixed by #4172
Closed

Reexport items needed to create a ShaderSource::Glsl #3559

yanchith opened this issue Mar 5, 2023 · 0 comments · Fixed by #4172
Labels
area: api Issues related to API surface help required We need community help to make this happen. type: enhancement New feature or request

Comments

@yanchith
Copy link
Contributor

yanchith commented Mar 5, 2023

Is your feature request related to a problem? Please describe.

I recently removed shaderc from my game's engine and started relying on naga to compile glsl in runtime (for both hot-reloading and not). All shaders work great, but the experience of doing this was somewhat sketchy.

ShaderSource::Glsl requires you to provide a naga::ShaderStage and a rustc_hash::FxHashMap, neither of which is exported from wgpu, unless I am mistaken. So I had to add top-level dependencies on these that version-match with what the gfx ecosystem uses.

Describe the solution you'd like
I'd like to import these directly from wgpu, something like:

let foo = wgpu::ShaderSource::Glsl {
    shader: Cow::from(FOO_VS),
    stage: wgpu::naga::ShaderStage::Vertex,
    defines: wgpu::naga::FastHashMap::default(),
}
@teoxoy teoxoy added type: enhancement New feature or request help required We need community help to make this happen. area: api Issues related to API surface labels Mar 6, 2023
@exrook exrook mentioned this issue Sep 25, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants