clean up some vulkan stuff for a lack of resolve targets
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "vulkan_commands.h"
|
||||
#include "stdio.h"
|
||||
|
||||
void beginRenderPass(gnCommandBuffer buffer, gnRenderPassInfo passInfo) {
|
||||
|
||||
VkClearValue* values = malloc(sizeof(VkClearValue) * passInfo.clearValueCount);
|
||||
for (int i = 0; i < passInfo.clearValueCount; i++) {
|
||||
values[i] = (VkClearValue){{{
|
||||
@@ -22,7 +24,6 @@ void beginRenderPass(gnCommandBuffer buffer, gnRenderPassInfo passInfo) {
|
||||
.clearValueCount = passInfo.clearValueCount,
|
||||
.pClearValues = values,
|
||||
};
|
||||
|
||||
vkCmdBeginRenderPass(buffer->commandBuffer->buffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
|
||||
}
|
||||
void endRenderPass(gnCommandBuffer buffer) {
|
||||
|
@@ -44,6 +44,8 @@ VkAccessFlags vkGryphnRenderPassAccess(gnRenderPassAccess access) {
|
||||
}
|
||||
|
||||
gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device, gnRenderPassDescriptorInfo info) {
|
||||
|
||||
|
||||
renderPass->renderPassDescriptor = malloc(sizeof(gnPlatformRenderPassDescriptor));
|
||||
|
||||
renderPass->renderPassDescriptor->attachmentCount = info.attachmentCount;
|
||||
@@ -79,9 +81,7 @@ gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device
|
||||
.attachment = info.subpassInfos[i].colorAttachments[c].index,
|
||||
.layout = vkGryphnImageLayout(info.subpassInfos[i].colorAttachments[c].imageLayout)
|
||||
};
|
||||
}
|
||||
|
||||
for (int c = 0; c < info.subpassInfos[i].colorAttachmentCount; c++) {
|
||||
if (info.subpassInfos[i].resolveAttachments != NULL)
|
||||
renderPass->renderPassDescriptor->resolveAttachments[i][c] = (VkAttachmentReference){
|
||||
.attachment = info.subpassInfos[i].resolveAttachments[c].index,
|
||||
.layout = vkGryphnImageLayout(info.subpassInfos[i].resolveAttachments[c].imageLayout)
|
||||
@@ -93,9 +93,11 @@ gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device
|
||||
.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
.colorAttachmentCount = info.subpassInfos[i].colorAttachmentCount,
|
||||
.pColorAttachments = renderPass->renderPassDescriptor->colorAttachments[i],
|
||||
.pResolveAttachments = renderPass->renderPassDescriptor->resolveAttachments[i]
|
||||
};
|
||||
|
||||
if (info.subpassInfos[i].resolveAttachments != NULL)
|
||||
renderPass->renderPassDescriptor->subpasses[i].pResolveAttachments = renderPass->renderPassDescriptor->resolveAttachments[i];
|
||||
|
||||
if (info.subpassInfos[i].depthAttachment != NULL) {
|
||||
renderPass->renderPassDescriptor->depthAttachments[i] = (VkAttachmentReference){
|
||||
.attachment = info.subpassInfos[i].depthAttachment->index,
|
||||
|
@@ -24,6 +24,7 @@ typedef struct gnPhysicalDeviceProperties {
|
||||
|
||||
typedef struct gnPhysicalDeviceFeatures {
|
||||
gnMultisampleCountFlags avaliableSamples;
|
||||
uint32_t maxMemoryAllocations;
|
||||
} gnPhysicalDeviceFeatures;
|
||||
|
||||
typedef enum gnQueueTypeFlags {
|
||||
|
Reference in New Issue
Block a user