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

Resizing windows with pipelined rendering enabled results in flickering and Vulkan validation errors #7437

Open
BeastLe9enD opened this issue Jan 31, 2023 · 3 comments
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior

Comments

@BeastLe9enD
Copy link
Contributor

Bevy version

Latest version from Github (5d514fb)

When I have a simple bevy example without the pipelined rendering plugin enabled, everything works fine when resizing the window. When the pipelined rendering plugin is added, the window is flickering while resizing and there are vulkan validation errors:

2023-01-31T12:53:07.394738Z ERROR wgpu_hal::vulkan::instance: VALIDATION [VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 (0x7cd0911d)]
	Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x22345e91a70, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1622,750), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (1620,756), minImageExtent = (1620,756), maxImageExtent = (1620,756). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://vulkan.lunarg.com/doc/view/1.3.239.0/windows/1.3-extensions/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)   

I don't know what exactly is going on there, but I can imagine that we need to wait for all frames being finished before resizing the window in the extract_windows system.

Here is the code I used:

use bevy::app::{App, PluginGroup, PluginGroupBuilder};
use bevy::DefaultPlugins;

pub struct SomePlugins;

impl PluginGroup for SomePlugins {
    fn build(self) -> PluginGroupBuilder {
        let mut group = PluginGroupBuilder::start::<Self>();
        group = group
            .add(bevy::log::LogPlugin::default())
            .add(bevy::core::TaskPoolPlugin::default())
            .add(bevy::core::TypeRegistrationPlugin::default())
            .add(bevy::core::FrameCountPlugin::default())
            .add(bevy::time::TimePlugin::default())
            .add(bevy::transform::TransformPlugin::default())
            .add(bevy::hierarchy::HierarchyPlugin::default())
            .add(bevy::diagnostic::DiagnosticsPlugin::default())
            .add(bevy::input::InputPlugin::default())
            .add(bevy::window::WindowPlugin::default());

        group = group.add(bevy::asset::AssetPlugin::default());
        group = group.add(bevy::scene::ScenePlugin::default());
        group = group.add(bevy::winit::WinitPlugin::default());
        group = group.add(bevy::render::RenderPlugin::default())
            .add(bevy::render::texture::ImagePlugin::default());
        //group = group.add(bevy::render::pipelined_rendering::PipelinedRenderingPlugin::default());
        group = group.add(bevy::core_pipeline::CorePipelinePlugin::default());
        group
    }
}

fn main() {
    App::new()
        .add_plugins(SomePlugins)
        .run();
}
@BeastLe9enD BeastLe9enD added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 31, 2023
@nicopap nicopap added A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in and removed S-Needs-Triage This issue needs to be labelled labels Jan 31, 2023
@BeastLe9enD
Copy link
Contributor Author

In the newest version, the flickering disappeared. The swapchain validation layer error still persists. I have not tested which commit actually fixed it, but it is not flickering anymore.

@JMS55
Copy link
Contributor

JMS55 commented Mar 4, 2023

Duplicate of #3451?

@JMS55 JMS55 added this to the 0.11 milestone Mar 4, 2023
@BeastLe9enD
Copy link
Contributor Author

BeastLe9enD commented Mar 4, 2023

Yea, the thing is the flickering was basically some different issue, but since it is fixed now, it is basically the same issue! Maybe we can close this issue then!

@JMS55 JMS55 removed this from the 0.11 milestone Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

No branches or pull requests

3 participants