Open lynn2910 opened 1 month ago
wgpu
's examples?
- Can you reproduce this on 0.14?
Yes, I updated the app to bevy 0.14 and the exact same error is triggered
- Can you reproduce this on
wgpu
's examples?
When compiling the examples of wgpu, I have errors on the linking with gcc, so I can't run them. However I was able to find a basic code which uses only wgpu (https://github.com/junglie85/wgpu-samples , the example 'hello-triangle') which didn't fired any error
- Please strip down the reproduction as far as possible to help us isolate the problem. This is definitely rendering related for example, so the state code is not needed.
I cloned the repository of bevy and ran the example 3d_scene
, with the same error when running it. I tried to remove any meshes, lights and even the camera, but the error occurs just the same
I get this issue on 0.14.
Adapter Info:
AdapterInfo { name: "AMD Radeon RX 6800 XT", vendor: 4098, device: 29631, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "24.6.1 (AMD proprietary shader compiler)", backend: Vulkan }
Error Messages:
2024-07-10T19:07:30.653026Z ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using ClearRenderTargetView on Command List (0x000001E5BF749CA0:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x000001E5BF73D5A0:'Unnamed ID3D12Resource Object') (subresource: 0)
is invalid for use as a render target. Expected State Bits (all): 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
2024-07-10T19:07:30.661540Z ERROR present_frames: wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using IDXGISwapChain::Present on Command List (0x000001E5BF6BCA00:'Internal DXGI CommandList'): Resource state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x000001E5BF73D5A0:'Unnamed ID3D12Resource Object') (subresource: 0)
is invalid for use as a PRESENT_SOURCE. Expected State Bits (all): 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Actual State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Missing State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
I'm hitting this as well on Windows 10.
My test source:
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.run();
}
Logs:
2024-07-11T02:45:31.001586Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu: "AMD Ryzen 7 5800X3D 8-Core Processor", core_count: "8", memory: "31.9 GiB" }
2024-07-11T02:45:31.164485Z INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 6900 XT", vendor: 4098, device: 29615, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "24.5.1 (AMD proprietary shader compiler)", backend: Vulkan }
2024-07-11T02:45:31.259497Z INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-07-11T02:45:31.337367Z ERROR wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using ClearRenderTargetView on Command List (0x00000231B48B4560:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x00000231B48A6B20:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target. Expected State Bits (all): 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
2024-07-11T02:45:31.356222Z ERROR present_frames: wgpu_hal::auxil::dxgi::exception: ID3D12CommandQueue::ExecuteCommandLists: Using IDXGISwapChain::Present on Command List (0x00000231B4829A90:'Internal DXGI CommandList'): Resource state (0x4: D3D12_RESOURCE_STATE_RENDER_TARGET) of resource (0x00000231B48A6B20:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a PRESENT_SOURCE. Expected State Bits (all): 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Actual State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET, Missing State: 0x0: D3D12_RESOURCE_STATE_[COMMON|PRESENT]. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
- Can you reproduce this on 0.14?
I hit this for 0.14.0
- Can you reproduce this on
wgpu
's examples?
I see nearly identical errors when I ran wgpu
's hello_triangle
example, Seems a similar issue is created for wgpu:
https://github.com/gfx-rs/wgpu/issues/4247
This is my first time trying to run Bevy on Windows, I haven't ran into this on Linux with AMD graphics but on windows it floods my terminal with these errors.
As per the the original poster's update on the issue description for wgpu
, I was able to set my WGPU_BACKEND
environment variable to either dx12
or vulkan
(even though this was what it was choosing before) to fix this issue for myself.
Bevy version
0.13.2
Relevant system information
Adapter informations:
Cargo version: cargo 1.78.0 (54d8815d0 2024-03-26) OS: Windows 11 (build 22631.3810)
What you did
I wrote the following code as a start for my new project
`constants.rs`
```rs use bevy::window::{PresentMode, WindowMode}; pub const WINDOW_NAME: &str = "Jsp"; pub const APP_ID: &str = "voxel_game_id"; pub const DEFAULT_WINDOW_MODE: WindowMode = WindowMode::Windowed; pub const DEFAULT_PRESENT_MODE: PresentMode = PresentMode::Immediate; pub mod graphic_settings { use bevy::core_pipeline::bloom::BloomSettings; pub const DEFAULT_BLOOM_SETTINGS: BloomSettings = BloomSettings::NATURAL; } ```What went wrong
I got these logs:
Where there is this error:
The window lagged for ~5s, and after everything was fine, but this error is definitely not something normal, and I can't find what causes this issue
Additional information
I thought it was a driver issue, but there isn't any driver update neither for windows or the NVIDIA card