[Mesa-dev] [RFC 06/12] anv/pass: Store the per-subpass view mask
Jason Ekstrand
jason at jlekstrand.net
Thu Mar 23 04:01:05 UTC 2017
---
src/intel/vulkan/anv_pass.c | 19 +++++++++++++++++++
src/intel/vulkan/anv_private.h | 2 ++
2 files changed, 21 insertions(+)
diff --git a/src/intel/vulkan/anv_pass.c b/src/intel/vulkan/anv_pass.c
index 4a1a340..42321db 100644
--- a/src/intel/vulkan/anv_pass.c
+++ b/src/intel/vulkan/anv_pass.c
@@ -23,6 +23,8 @@
#include "anv_private.h"
+#include "util/vk_util.h"
+
VkResult anv_CreateRenderPass(
VkDevice _device,
const VkRenderPassCreateInfo* pCreateInfo,
@@ -111,6 +113,7 @@ VkResult anv_CreateRenderPass(
subpass->input_count = desc->inputAttachmentCount;
subpass->color_count = desc->colorAttachmentCount;
subpass->attachments = p;
+ subpass->view_mask = 0;
if (desc->inputAttachmentCount > 0) {
subpass->input_attachments = p;
@@ -186,6 +189,22 @@ VkResult anv_CreateRenderPass(
}
}
+ vk_foreach_struct(ext, pCreateInfo->pNext) {
+ switch (ext->sType) {
+ case VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHX: {
+ VkRenderPassMultiviewCreateInfoKHX *mv = (void *)ext;
+
+ for (uint32_t i = 0; i < mv->subpassCount; i++) {
+ pass->subpasses[i].view_mask = mv->pViewMasks[i];
+ }
+ break;
+ }
+
+ default:
+ anv_debug_ignored_stype(ext->sType);
+ }
+ }
+
*pRenderPass = anv_render_pass_to_handle(pass);
return VK_SUCCESS;
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index fd82ce9..d578c69 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1970,6 +1970,8 @@ struct anv_subpass {
VkAttachmentReference depth_stencil_attachment;
+ uint32_t view_mask;
+
/** Subpass has a depth/stencil self-dependency */
bool has_ds_self_dep;
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list