Open suprohub opened 1 week ago
Does this also happen on the create-image
branch?
yes
its because subtracting 1 - 720
so if we dont render if hide game - game not crash
but if we move cursor in task bar to get preview of game and open - game crashes with wgpu validation error (seems vulkan isue)
`thread 'main' panicked at C:\Users\superpc.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.20.1\src\backend\wgpu_core.rs:2996:5: wgpu error: Validation Error
Caused by: In Device::create_buffer note: label = Instance Buffer Buffer size 607403904 is greater than the maximum buffer size (268435456)
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\std\src\panicking.rs:652
1: core::panicking::panic_fmt
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library\core\src\panicking.rs:72
2: wgpu::backend::wgpu_core::default_error_handler
at C:\Users\superpc.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.20.1\src\backend\wgpu_core.rs:2996
3: core::ops::function::Fn::call<void (*)(enum2$
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\core\src\panic\unwind_safe.rs:272
22: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0
at C:\Users\superpc.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.30.3\src\platform_impl\windows\event_loop\runner.rs:230
28: winit::platform_impl::platform::event_loop::runner::EventLoopRunner
at C:\Users\superpc.cargo\registry\src\index.crates.io-6f17d22bba15001f\winit-0.30.3\src\platform_impl\windows\event_loop.rs:222
52: winit::event_loop::EventLoop
Process finished with exit code -1073740791 (0xC0000409)
`
Hmm thanks for the details, but this is a bit hard to implement blindly. Is there a specific winit
WindowEvent
that happens when it renders like that on Windows?
Hmm thanks for the details, but this is a bit hard to implement blindly. Is there a specific
winit
WindowEvent
that happens when it renders like that on Windows?
no
ok its my issue
i return function to not render
but instance buffer increasing very fast if return
println!("{:?}", instances_bytes.len()); 10320 10320 10320 10320 440325504
Ah, that's probably the framerate calculation of the update function that tries to catch up, I'll add an upper bound so it doesn't get called too often.
Ah, that's probably the framerate calculation of the update function that tries to catch up, I'll add an upper bound so it doesn't get called too often.
add return if render value very smol (like 1)
render wight and heifht
println!("{:?}", instances_bytes.len()); 10320 10320 10320 10320 440325504
This should be fixed now in https://github.com/tversteeg/chuot/commit/c81e87294d35be851a860cbfcb1679efa4a00d03.
not its not fix this
remind you i set letter box to 0.0 for not crashing and add return in render if surface 1 x 1
Ah sorry, can you open a PR for that as well?
Ah sorry, can you open a PR for that as well? this code fix this err ` let (instances_bytes, instances_len) = { // Construct the bytes of the instances to upload (self.instances.bytes(), self.instances.len()) }; // Resize the buffer if needed let instance_buffer_already_pushed = if instances_bytes.len() as u64 > self.instance_buffer.size() { // We have more instances than the buffer size, recreate the buffer self.instance_buffer.destroy(); self.instance_buffer = self.device .create_buffer_init(&wgpu::util::BufferInitDescriptor { label: Some("Instance Buffer"), contents: instances_bytes, usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, });
true
} else {
false
};`
o
seems solved but would like clear buffer if app long time not open
Which buffer do you want to clear?
if collapse app crashes
[2024-06-27T22:34:30Z ERROR wgpu::backend::wgpu_core] Handling wgpu errors as fatal by default thread 'main' panicked at C:\Users\sere.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.20.1\src\backend\wgpu_core.rs:2996:5: wgpu error: Validation Error
Caused by: In a RenderPass note: encoder =
Pixel Game Command Encoder
In a set_viewport command Viewport has invalid rect Rect { x: 2147483300.0, y: 2147483400.0, w: 720.0, h: 576.0 }; origin and/or size is less than or equal to 0, and/or is not contained in the render target (1, 1, 1)