bindbc-sdl icon indicating copy to clipboard operation
bindbc-sdl copied to clipboard

`SDL_SYSWM_UNKNOWN` on Linux/X11

Open holdengreen opened this issue 2 years ago • 5 comments

Running the demo in bindbc-wgpu.

Nothing should be wrong with my X11, the equivalent Rust code works, and running in a VM with mesa had the same results.

holdengreen avatar May 03 '22 02:05 holdengreen

If this is a problem with the binding, I'm going to this is a problem with the binding, I'm going to need more context in order to find out what it is.

  • Which Linux distro?
  • 32-bit or 64-bit?
  • Which SDL version?
  • Does the program fail to do what it's supposed to do, or is it simply a case of SDL_GetWindowWMInfo returning the wrong info?
  • Did you try a minimal program that just loads SDL?

mdparker avatar May 04 '22 03:05 mdparker

  1. I am on Manjaro, the VM was Debian.
  2. 64 bit
  3. compiled against 2.0.10, linking against 2.0.20.
  4. Sorry for the lack of context I am trying to render with wgpu, otherwise it works, but I may try again with wgpu since adr helped me with that.
  5. Now I have and it works with some built in rendering.

holdengreen avatar May 04 '22 03:05 holdengreen

Okay, so then it sounds like the problem isn't in the SDL binding. I'll try to make some time this week to see if I can get the wgpu demo to work on my Unbuntu installation. Please let me know if you figure it out before then.

mdparker avatar May 04 '22 03:05 mdparker

Yes I am pretty pretty sure it is an issue with X11 and SDL here. I am transcribing the wgpu-native triangle example to D.

When I adapt it to optionally run with adr's simpledisplay.d it has no issue.

When using bindbc-sdl:

  • Callback messages (wgpuSetLogCallback):
get_physical_device_surface_capabilities: Initialization of a object has failed
get_physical_device_surface_capabilities: Initialization of a object has failed
  • Backtrace (
thread '<unnamed>' panicked at 'Unable to request adapter: NotFound', src/device.rs:51:10
stack backtrace:
   0: rust_begin_unwind
             at /rustc/18f314e7027fe7084aaab8620c624a0d7bd29e70/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/18f314e7027fe7084aaab8620c624a0d7bd29e70/library/core/src/panicking.rs:142:14
   2: core::result::unwrap_failed
             at /rustc/18f314e7027fe7084aaab8620c624a0d7bd29e70/library/core/src/result.rs:1785:5
   3: core::result::Result<T,E>::expect
             at /rustc/18f314e7027fe7084aaab8620c624a0d7bd29e70/library/core/src/result.rs:1035:23
   4: wgpuInstanceRequestAdapter
             at /home/holden/1/work/test/D/9/wgpu-native/src/device.rs:42:22
   5: _Dmain
             at ./src/main.d:144
   6: _D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZ9__lambda2MFZv
   7: _D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv
   8: _D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv
   9: _D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv
  10: _d_run_main2
  11: _d_run_main
  12: main
             at /usr/include/dlang/dmd/core/internal/entrypoint.d:29
  13: __libc_start_call_main
  14: __libc_start_main@GLIBC_2.2.5
  15: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
Program exited with code -6
Full exception: object.Exception@source/dub/generators/build.d(554): Program exited with code -6

holdengreen avatar May 06 '22 05:05 holdengreen

code for reference: https://github.com/holdengreen/wgpu-triangle-in-Dlang/blob/main/src/main.d

holdengreen avatar May 06 '22 20:05 holdengreen

Has this issue been resolved? If not, are you able to confirm that it's an issue with bindbc-sdl and not bindbc-wgpu? bindbc-wgpu is not an official BindBC library, so I don't know much about it.

ichordev avatar Dec 11 '22 16:12 ichordev