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

textureStore causes a panic on GL backend with compute shaders. #3337

Closed
KiranWells opened this issue Dec 28, 2022 · 2 comments
Closed

textureStore causes a panic on GL backend with compute shaders. #3337

KiranWells opened this issue Dec 28, 2022 · 2 comments

Comments

@KiranWells
Copy link

Description
When using the textureStore function in a compute shader, naga validates the shader but the gles hal layer panics with "Unsupported uniform type!". I get no errors when using the Vulkan backend, and the program works as expected. As far as I can tell from other references online (such as this post), this operation should be supported. However, I have very little experience with wgpu and compute shaders, so please correct me if I am wrong.

Repro steps
Create a compute pipeline with any shader that uses the textureStore function with the gles backend. For example:

// texture
@group(0) @binding(0) var my_tex: texture_storage_2d<rgba8unorm, write>;

@compute @workgroup_size(16, 16, 1)
fn main_color(@builtin(global_invocation_id) global_id: vec3<u32>) {
    textureStore(my_tex, vec2<i32>(i32(global_id.x), i32(global_id.y)), vec4<f32>(0.5));
}

Expected vs observed behavior
I expect this to fill the entire texture with a half-transparent gray. However, it panics when creating the compute pipeline.

Extra materials

Error log:
Adapter info: AdapterInfo { name: "Mesa Intel(R) UHD Graphics 620 (KBL GT2)", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }
thread 'main' panicked at 'Unsupported uniform datatype!', /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/gles/conv.rs:447:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: wgpu_hal::gles::conv::uniform_byte_size
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/gles/conv.rs:447:14
   3: wgpu_hal::gles::device::<impl wgpu_hal::gles::Device>::create_pipeline
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/gles/device.rs:316:36
   4: wgpu_hal::gles::device::<impl wgpu_hal::Device<wgpu_hal::gles::Api> for wgpu_hal::gles::Device>::create_compute_pipeline
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/gles/device.rs:1049:21
   5: wgpu_core::device::Device<A>::create_compute_pipeline
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.14.2/src/device/mod.rs:2427:22
   6: wgpu_core::device::<impl wgpu_core::hub::Global<G>>::device_create_compute_pipeline
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.14.2/src/device/mod.rs:4943:34
   7: <wgpu::backend::direct::Context as wgpu::Context>::device_create_compute_pipeline
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.2/src/backend/direct.rs:1447:27
   8: wgpu::Device::create_compute_pipeline
             at /home/kiran/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.2/src/lib.rs:2202:17
   9: accelerated_mandel::test
             at ./src/main.rs:69:27
  10: accelerated_mandel::main
             at ./src/main.rs:118:5
  11: core::ops::function::FnOnce::call_once
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Platform
Information about your OS, version of wgpu, your tech stack, etc.
OS: Arch Linux (rolling)
wgpu version: 0.14.2 (also having the same issue on the latest git version)
Adapter info: AdapterInfo { name: "Mesa Intel(R) UHD Graphics 620 (KBL GT2)", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }

@James2022-rgb
Copy link
Contributor

This should work now.

@teoxoy
Copy link
Member

teoxoy commented Jan 14, 2023

Fixed by #3361

@teoxoy teoxoy closed this as completed Jan 14, 2023
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

No branches or pull requests

3 participants