Closed caiiiycuk closed 2 years ago
Does vange-rs work for you if you set GL in the config (as "backend: GL")?
Road works fine on GL backend.
I think there is some UB in my build, will look into it tomorrow
Nope valgrind shows that there is no errors
and it works in browser :)
Could you reproduce this via https://github.com/lpenguin/rv_ffi ?
I can reproduce it in rv_ffi. It fails from the commit https://github.com/kvark/vange-rs/commit/2341f55274e7723801fbf288710eb7f5cb8d8df5 (Water: first implementation). I pushed a small fix to it, so you may need a pull.
Yep same here
caiiiycuk@caiiiycuk-ubuntu:~/gamepix/games/Vangers/res_linux$ RUST_BACKTRACE=1 ~/tmp/rv_ffi/build/rv_ffi
GL version: OpenGL ES 3.2 Mesa 21.2.2
rv_init
rv_map_init
rv_map_update_palette
rv_camera_init
rv_map_update_data
rv_camera_set_transform position=1024 1024 512, rotation=-0.5 -0 -0 0.866025
rv_render
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-hal/src/gles/command.rs:98:38
stack backtrace:
0: rust_begin_unwind
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
2: core::panicking::panic
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:50:5
3: core::option::Option<T>::unwrap
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/option.rs:746:21
4: wgpu_hal::gles::command::<impl wgpu_hal::gles::CommandEncoder>::rebind_vertex_data
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-hal/src/gles/command.rs:98:26
5: wgpu_hal::gles::command::<impl wgpu_hal::gles::CommandEncoder>::prepare_draw
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-hal/src/gles/command.rs:158:13
6: wgpu_hal::gles::command::<impl wgpu_hal::CommandEncoder<wgpu_hal::gles::Api> for wgpu_hal::gles::CommandEncoder>::draw
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-hal/src/gles/command.rs:845:9
7: wgpu_core::command::render::<impl wgpu_core::hub::Global<G>>::command_encoder_run_render_pass_impl
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-core/src/command/render.rs:1534:29
8: wgpu_core::command::render::<impl wgpu_core::hub::Global<G>>::command_encoder_run_render_pass
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-core/src/command/render.rs:1018:9
9: <wgpu::backend::direct::Context as wgpu::Context>::command_encoder_end_render_pass
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu/src/backend/direct.rs:2007:13
10: <wgpu::RenderPass as core::ops::drop::Drop>::drop
at /home/caiiiycuk/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu/src/lib.rs:2825:13
11: core::ptr::drop_in_place<wgpu::RenderPass>
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ptr/mod.rs:188:1
12: vangers::render::Render::draw_world
at /home/caiiiycuk/gamepix/games/vange-rs-em/src/render/mod.rs:761:9
13: rv_render
at /home/caiiiycuk/gamepix/games/vange-rs-em/lib/ffi/src/lib.rs:393:5
14: main
15: __libc_start_call_main
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
16: __libc_start_main_impl
at ./csu/../csu/libc-start.c:409:3
17: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
fatal runtime error: failed to initiate panic, error 5
Аварийный останов (стек памяти сброшен на диск)
caiiiycuk@caiiiycuk-ubuntu:~/gamepix/games/Vangers/res_linux$
I can confirm: 950a5dd30e374c5e8cd28d7742eec814301c4ed2 - works 2341f55274e7723801fbf288710eb7f5cb8d8df5 - not working
looks like some memory stomping is taking place:
at /home/kvark/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/77b2c25/wgpu-hal/src/gles/command.rs:98
98 let vb = vb.as_ref().unwrap();
(gdb) p index
$1 = 1
(gdb) p first_instance
$2 = 0
(gdb) p self.state.vertex_buffers
$3 = [
Aborted (core dumped)
i.e. just printing the state leads to a core dump. This is unusual.
Hm, it could be something from the C++ side also, I'll check it
no, it's just my debugger being buggy. The logic bug is in wgpu-hal/gles. Fix is coming!
Fixes in 671a10adeca6f8df6b9d3d4fd7772ba614f8f8a7, which carries https://github.com/gfx-rs/wgpu/pull/2427
I compiled render-ng branch natively, but when I try to run it constantly fails with error:
Here:
GPU: [2022-01-26T08:22:28Z INFO wgpu_hal::gles::adapter] Vendor: Intel [2022-01-26T08:22:28Z INFO wgpu_hal::gles::adapter] Renderer: Mesa Intel(R) HD Graphics 620 (KBL GT2) [2022-01-26T08:22:28Z INFO wgpu_hal::gles::adapter] Version: OpenGL ES 3.2 Mesa 21.2.
Full log full-log.txt