render_plugin: Begin add window plugin
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 3m7s

This commit is contained in:
Florian RICHER 2025-05-18 19:28:34 +02:00
parent 0ee29a3649
commit ae0a2be097
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
8 changed files with 134 additions and 48 deletions

View file

@ -17,28 +17,29 @@ use bevy_app::{App, Plugin};
mod utils;
mod window_render_context;
#[derive(Resource)]
pub struct VulkanInstance(Arc<Instance>);
#[derive(Resource, Clone)]
pub struct VulkanInstance(pub Arc<Instance>);
#[derive(Resource)]
pub struct VulkanDevice(Arc<Device>);
#[derive(Resource, Clone)]
pub struct VulkanDevice(pub Arc<Device>);
#[derive(Resource)]
pub struct VulkanGraphicsQueue(Arc<Queue>);
#[derive(Resource, Clone)]
pub struct VulkanGraphicsQueue(pub Arc<Queue>);
#[derive(Resource)]
pub struct VulkanComputeQueue(Arc<Queue>);
#[derive(Resource, Clone)]
pub struct VulkanComputeQueue(pub Arc<Queue>);
#[derive(Resource)]
pub struct VulkanTransferQueue(Arc<Queue>);
#[derive(Resource)]
pub struct VulkanMemoryAllocator(Arc<StandardMemoryAllocator>);
#[derive(Resource, Clone)]
pub struct VulkanTransferQueue(pub Arc<Queue>);
#[derive(Resource)]
pub struct VulkanCommandBufferAllocator(Arc<StandardCommandBufferAllocator>);
#[derive(Resource, Clone)]
pub struct VulkanMemoryAllocator(pub Arc<StandardMemoryAllocator>);
#[derive(Resource)]
pub struct VulkanDescriptorSetAllocator(Arc<StandardDescriptorSetAllocator>);
#[derive(Resource, Clone)]
pub struct VulkanCommandBufferAllocator(pub Arc<StandardCommandBufferAllocator>);
#[derive(Resource, Clone)]
pub struct VulkanDescriptorSetAllocator(pub Arc<StandardDescriptorSetAllocator>);
#[derive(Debug, thiserror::Error)]
pub enum VulkanError {
@ -82,13 +83,4 @@ impl Plugin for VulkanPlugin {
create_and_insert_instance(world, &self.vulkan_config);
create_and_insert_device(world, &self.vulkan_config);
}
fn ready(&self, app: &App) -> bool {
app.world().get_resource::<WindowWrapper>().is_some()
}
fn finish(&self, app: &mut App) {
let window_render_context = WindowRenderContext::from(app as &App);
app.world_mut().insert_resource(window_render_context);
}
}