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

[glsl-out] Support push constant emulation #799

Closed
Herschel opened this issue Apr 29, 2021 · 1 comment
Closed

[glsl-out] Support push constant emulation #799

Herschel opened this issue Apr 29, 2021 · 1 comment
Labels
area: back-end Outputs of shader conversion kind: feature New feature or request lang: GLSL OpenGL Shading Language

Comments

@Herschel
Copy link

Herschel commented Apr 29, 2021

gfx/wgpu ostensibly supports emulating push constants using uniform buffers on non-Vulkan backends, including GL. However, naga currently errors when translating a shader to GLSL using push constants with PushConstantNotSupported. Ideally the shader is translated to use uniforms the way that gfx/wgpu expects.

Sample shader:
color.vert.zip

cargo run --features spv-in,glsl-out -- color.frag.spv color.out.frag

    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target\debug\naga.exe color.vert.spv color.vert.frag`
Push constants aren't supported:
error: process didn't exit successfully: `target\debug\naga.exe color.frag.spv color.out.frag` (exit code: 1)

Sample repo using wgpu-rs:

git clone -b gl https://github.com/Herschel/ruffle
cargo run --package ruffle_desktop -- -g gl magicaltrevor.swf

wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
    Internal error in stage VERTEX: Shader module failed to compile: PushConstantNotSupported shader compilation failed: Vertex


thread 'main' panicked at 'Handling wgpu errors as fatal by default', /home/mwelsh/.cargo/git/checkouts/wgpu-rs-40ea39809c03c5d8/80fdbd2/src/backend/direct.rs:1942:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

naga @ 93e57ff

@Herschel Herschel changed the title [glsl-out] Support push constants [glsl-out] Support push constant emulation Apr 29, 2021
@kvark kvark added area: back-end Outputs of shader conversion kind: feature New feature or request lang: GLSL OpenGL Shading Language labels Apr 29, 2021
@JCapucho
Copy link
Collaborator

Fixed in #1683

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: back-end Outputs of shader conversion kind: feature New feature or request lang: GLSL OpenGL Shading Language
Projects
None yet
Development

No branches or pull requests

3 participants