Module: Mesa
Branch: main
Commit: 2e83aed8b38d9cf20e01c696fb76e0a3d3ac46dc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e83aed8b38d9cf20e01c696fb76e0a3d3ac46dc

Author: Connor Abbott <[email protected]>
Date:   Fri May 26 15:42:52 2023 +0200

vk/graphics_state: Add vk_pipeline_flags_feedback_loops helper

This will be useful for combining dynamic and static feedback loop
state.

Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25436>

---

 src/vulkan/runtime/vk_graphics_state.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/vulkan/runtime/vk_graphics_state.h 
b/src/vulkan/runtime/vk_graphics_state.h
index c56366a9fbf..d6c8c68b020 100644
--- a/src/vulkan/runtime/vk_graphics_state.h
+++ b/src/vulkan/runtime/vk_graphics_state.h
@@ -694,6 +694,19 @@ struct vk_render_pass_state {
    uint8_t depth_stencil_attachment_samples;
 };
 
+static inline VkImageAspectFlags
+vk_pipeline_flags_feedback_loops(VkPipelineCreateFlags2KHR flags)
+{
+   VkImageAspectFlags feedback_loops = 0;
+   if (flags &
+       VK_PIPELINE_CREATE_2_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT)
+      feedback_loops |= VK_IMAGE_ASPECT_COLOR_BIT;
+   if (flags &
+       VK_PIPELINE_CREATE_2_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT)
+      feedback_loops |= VK_IMAGE_ASPECT_DEPTH_BIT;
+   return feedback_loops;
+}
+
 /** Struct representing all dynamic graphics state
  *
  * Before invoking any core functions, the driver must properly populate

Reply via email to