vk/0.210.0: Rework render pass description structures
This commit is contained in:
@@ -1926,21 +1926,21 @@ typedef struct VkAttachmentReference {
|
||||
typedef struct VkSubpassDescription {
|
||||
VkSubpassDescriptionFlags flags;
|
||||
VkPipelineBindPoint pipelineBindPoint;
|
||||
uint32_t inputCount;
|
||||
uint32_t inputAttachmentCount;
|
||||
const VkAttachmentReference* pInputAttachments;
|
||||
uint32_t colorCount;
|
||||
uint32_t colorAttachmentCount;
|
||||
const VkAttachmentReference* pColorAttachments;
|
||||
const VkAttachmentReference* pResolveAttachments;
|
||||
VkAttachmentReference depthStencilAttachment;
|
||||
uint32_t preserveCount;
|
||||
const VkAttachmentReference* pDepthStencilAttachment;
|
||||
uint32_t preserveAttachmentCount;
|
||||
const VkAttachmentReference* pPreserveAttachments;
|
||||
} VkSubpassDescription;
|
||||
|
||||
typedef struct VkSubpassDependency {
|
||||
uint32_t srcSubpass;
|
||||
uint32_t destSubpass;
|
||||
uint32_t dstSubpass;
|
||||
VkPipelineStageFlags srcStageMask;
|
||||
VkPipelineStageFlags destStageMask;
|
||||
VkPipelineStageFlags dstStageMask;
|
||||
VkMemoryOutputFlags outputMask;
|
||||
VkMemoryInputFlags inputMask;
|
||||
VkBool32 byRegion;
|
||||
|
@@ -199,18 +199,18 @@ anv_device_init_meta_blit_state(struct anv_device *device)
|
||||
.subpassCount = 1,
|
||||
.pSubpasses = &(VkSubpassDescription) {
|
||||
.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
.inputCount = 0,
|
||||
.colorCount = 1,
|
||||
.inputAttachmentCount = 0,
|
||||
.colorAttachmentCount = 1,
|
||||
.pColorAttachments = &(VkAttachmentReference) {
|
||||
.attachment = 0,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
},
|
||||
.pResolveAttachments = NULL,
|
||||
.depthStencilAttachment = (VkAttachmentReference) {
|
||||
.pDepthStencilAttachment = &(VkAttachmentReference) {
|
||||
.attachment = VK_ATTACHMENT_UNUSED,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
},
|
||||
.preserveCount = 1,
|
||||
.preserveAttachmentCount = 1,
|
||||
.pPreserveAttachments = &(VkAttachmentReference) {
|
||||
.attachment = 0,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
|
@@ -737,18 +737,18 @@ void anv_CmdClearColorImage(
|
||||
.subpassCount = 1,
|
||||
.pSubpasses = &(VkSubpassDescription) {
|
||||
.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
.inputCount = 0,
|
||||
.colorCount = 1,
|
||||
.inputAttachmentCount = 0,
|
||||
.colorAttachmentCount = 1,
|
||||
.pColorAttachments = &(VkAttachmentReference) {
|
||||
.attachment = 0,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
},
|
||||
.pResolveAttachments = NULL,
|
||||
.depthStencilAttachment = (VkAttachmentReference) {
|
||||
.pDepthStencilAttachment = &(VkAttachmentReference) {
|
||||
.attachment = VK_ATTACHMENT_UNUSED,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
},
|
||||
.preserveCount = 1,
|
||||
.preserveAttachmentCount = 1,
|
||||
.pPreserveAttachments = &(VkAttachmentReference) {
|
||||
.attachment = 0,
|
||||
.layout = VK_IMAGE_LAYOUT_GENERAL,
|
||||
|
@@ -68,26 +68,28 @@ VkResult anv_CreateRenderPass(
|
||||
const VkSubpassDescription *desc = &pCreateInfo->pSubpasses[i];
|
||||
struct anv_subpass *subpass = &pass->subpasses[i];
|
||||
|
||||
subpass->input_count = desc->inputCount;
|
||||
subpass->color_count = desc->colorCount;
|
||||
subpass->input_count = desc->inputAttachmentCount;
|
||||
subpass->color_count = desc->colorAttachmentCount;
|
||||
|
||||
if (desc->inputCount > 0) {
|
||||
if (desc->inputAttachmentCount > 0) {
|
||||
subpass->input_attachments =
|
||||
anv_device_alloc(device, desc->inputCount * sizeof(uint32_t),
|
||||
anv_device_alloc(device,
|
||||
desc->inputAttachmentCount * sizeof(uint32_t),
|
||||
8, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
|
||||
|
||||
for (uint32_t j = 0; j < desc->inputCount; j++) {
|
||||
for (uint32_t j = 0; j < desc->inputAttachmentCount; j++) {
|
||||
subpass->input_attachments[j]
|
||||
= desc->pInputAttachments[j].attachment;
|
||||
}
|
||||
}
|
||||
|
||||
if (desc->colorCount > 0) {
|
||||
if (desc->colorAttachmentCount > 0) {
|
||||
subpass->color_attachments =
|
||||
anv_device_alloc(device, desc->colorCount * sizeof(uint32_t),
|
||||
anv_device_alloc(device,
|
||||
desc->colorAttachmentCount * sizeof(uint32_t),
|
||||
8, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
|
||||
|
||||
for (uint32_t j = 0; j < desc->colorCount; j++) {
|
||||
for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
|
||||
subpass->color_attachments[j]
|
||||
= desc->pColorAttachments[j].attachment;
|
||||
}
|
||||
@@ -95,16 +97,22 @@ VkResult anv_CreateRenderPass(
|
||||
|
||||
if (desc->pResolveAttachments) {
|
||||
subpass->resolve_attachments =
|
||||
anv_device_alloc(device, desc->colorCount * sizeof(uint32_t),
|
||||
anv_device_alloc(device,
|
||||
desc->colorAttachmentCount * sizeof(uint32_t),
|
||||
8, VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
|
||||
|
||||
for (uint32_t j = 0; j < desc->colorCount; j++) {
|
||||
for (uint32_t j = 0; j < desc->colorAttachmentCount; j++) {
|
||||
subpass->resolve_attachments[j]
|
||||
= desc->pResolveAttachments[j].attachment;
|
||||
}
|
||||
}
|
||||
|
||||
subpass->depth_stencil_attachment = desc->depthStencilAttachment.attachment;
|
||||
if (desc->pDepthStencilAttachment) {
|
||||
subpass->depth_stencil_attachment =
|
||||
desc->pDepthStencilAttachment->attachment;
|
||||
} else {
|
||||
subpass->depth_stencil_attachment = VK_ATTACHMENT_UNUSED;
|
||||
}
|
||||
}
|
||||
|
||||
*pRenderPass = anv_render_pass_to_handle(pass);
|
||||
|
Reference in New Issue
Block a user