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

draw_capture_hi_res example panics when running with opengles backend #915

Open
alansartorio opened this issue Apr 20, 2023 · 0 comments
Open

Comments

@alansartorio
Copy link

If I force the draw_capture_hi_res example to use opengles backend like this:

diff
diff --git a/examples/draw/draw_capture_hi_res.rs b/examples/draw/draw_capture_hi_res.rs
index 79635b9..2e90350 100644
--- a/examples/draw/draw_capture_hi_res.rs
+++ b/examples/draw/draw_capture_hi_res.rs
@@ -4,7 +4,7 @@
 use nannou::prelude::*;
 
 fn main() {
-    nannou::app(model).update(update).exit(exit).run();
+    nannou::app(model).backends(wgpu::Backends::GL).update(update).exit(exit).run();
 }
 
 struct Model {

It panics when I run it in release mode

cargo run --example=draw_capture_hi_res --release

output
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `nannou render pipeline`
    Internal error in FRAGMENT shader: 0:19(19): error: no matching function for call to `textureSize(sampler2DMS, int)'; candidates are:
0:19(19): error:    int textureSize(sampler1D, int)
0:19(19): error:    int textureSize(isampler1D, int)
0:19(19): error:    int textureSize(usampler1D, int)
0:19(19): error:    ivec2 textureSize(sampler2D, int)
0:19(19): error:    ivec2 textureSize(isampler2D, int)
0:19(19): error:    ivec2 textureSize(usampler2D, int)
0:19(19): error:    ivec3 textureSize(sampler3D, int)
0:19(19): error:    ivec3 textureSize(isampler3D, int)
0:19(19): error:    ivec3 textureSize(usampler3D, int)
0:19(19): error:    ivec2 textureSize(samplerCube, int)
0:19(19): error:    ivec2 textureSize(isamplerCube, int)
0:19(19): error:    ivec2 textureSize(usamplerCube, int)
0:19(19): error:    int textureSize(sampler1DShadow, int)
0:19(19): error:    ivec2 textureSize(sampler2DShadow, int)
0:19(19): error:    ivec2 textureSize(samplerCubeShadow, int)
0:19(19): error:    ivec2 textureSize(sampler1DArray, int)
0:19(19): error:    ivec2 textureSize(isampler1DArray, int)
0:19(19): error:    ivec2 textureSize(usampler1DArray, int)
0:19(19): error:    ivec3 textureSize(sampler2DArray, int)
0:19(19): error:    ivec3 textureSize(isampler2DArray, int)
0:19(19): error:    ivec3 textureSize(usampler2DArray, int)
0:19(19): error:    ivec2 textureSize(sampler1DArrayShadow, int)
0:19(19): error:    ivec3 textureSize(sampler2DArrayShadow, int)
0:19(19): error:    ivec3 textureSize(samplerCubeArray, int)
0:19(19): error:    ivec3 textureSize(isamplerCubeArray, int)
0:19(19): error:    ivec3 textureSize(usamplerCubeArray, int)
0:19(19): error:    ivec3 textureSize(samplerCubeArrayShadow, int)
0:19(19): error:    ivec2 textureSize(sampler2DRect)
0:19(19): error:    ivec2 textureSize(isampler2DRect)
0:19(19): error:    ivec2 textureSize(usampler2DRect)
0:19(19): error:    ivec2 textureSize(sampler2DRectShadow)
0:19(19): error:    int textureSize(samplerBuffer)
0:19(19): error:    int textureSize(isamplerBuffer)
0:19(19): error:    int textureSize(usamplerBuffer)
0:19(19): error:    ivec2 textureSize(sampler2DMS)
0:19(19): error:    ivec2 textureSize(isampler2DMS)
0:19(19): error:    ivec2 textureSize(usampler2DMS)
0:19(19): error:    ivec3 textureSize(sampler2DMSArray)
0:19(19): error:    ivec3 textureSize(isampler2DMSArray)
0:19(19): error:    ivec3 textureSize(usampler2DMSArray)
0:19(19): error: type mismatch
0:20(25): warning: `tex_size' used uninitialized
0:21(25): warning: `tex_size' used uninitialized


', /home/alan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.11.1/src/backend/direct.rs:2195:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: queue 0x55f66c7f0c20 destroyed while proxies still attached:
  xdg_wm_base@19 still attached
  wl_surface@18 still attached
  wl_output@13 still attached
  xdg_activation_v1@12 still attached
  zwp_text_input_manager_v3@11 still attached
  zwp_relative_pointer_manager_v1@10 still attached
  zwp_pointer_constraints_v1@9 still attached
  zxdg_decoration_manager_v1@8 still attached
  wl_seat@7 still attached
  wl_subcompositor@6 still attached
  wl_compositor@5 still attached
  wl_shm@4 still attached
  wl_registry@2 still attached
[1]    7421 segmentation fault  cargo run --example=draw_capture_hi_res --release

I think the last warning is not relevant to this issue.

When I try running it with x11 winit backend with WINIT_UNIX_BACKEND=x11 cargo run --example=draw_capture_hi_res --release I get:

output
thread 'main' panicked at 'Error in Surface::configure: invalid surface', /home/alan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.11.1/src/backend/direct.rs:204:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

If I don't apply the change to force GL backend, it uses Vulkan and it works well.

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

1 participant