From e76d35d8d537fac54df4e941dfab0578e5147e94 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Sun, 2 Mar 2025 08:37:05 +0100 Subject: [PATCH] Add convenience function for graphics pipe --- vulkan-rs/src/pipelines/graphics_pipeline.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/vulkan-rs/src/pipelines/graphics_pipeline.rs b/vulkan-rs/src/pipelines/graphics_pipeline.rs index 276e940..114ea25 100644 --- a/vulkan-rs/src/pipelines/graphics_pipeline.rs +++ b/vulkan-rs/src/pipelines/graphics_pipeline.rs @@ -307,6 +307,21 @@ impl GraphicsPipelineBuilder { self } + pub fn whole_area(self, width: u32, height: u32) -> Self { + self.add_viewport(VkViewport { + x: 0.0, + y: 0.0, + width: width as f32, + height: height as f32, + minDepth: 0.0, + maxDepth: 1.0, + }) + .add_scissor(VkRect2D { + offset: VkOffset2D { x: 0, y: 0 }, + extent: VkExtent2D { width, height }, + }) + } + pub fn build( mut self, device: Arc,