clean up some vulkan stuff for a lack of resolve targets

This commit is contained in:
Gregory Wells
2025-07-09 14:52:15 -04:00
parent 1e26afe6a5
commit 1022ad6cb5
3 changed files with 9 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
#include "vulkan_commands.h" #include "vulkan_commands.h"
#include "stdio.h"
void beginRenderPass(gnCommandBuffer buffer, gnRenderPassInfo passInfo) { void beginRenderPass(gnCommandBuffer buffer, gnRenderPassInfo passInfo) {
VkClearValue* values = malloc(sizeof(VkClearValue) * passInfo.clearValueCount); VkClearValue* values = malloc(sizeof(VkClearValue) * passInfo.clearValueCount);
for (int i = 0; i < passInfo.clearValueCount; i++) { for (int i = 0; i < passInfo.clearValueCount; i++) {
values[i] = (VkClearValue){{{ values[i] = (VkClearValue){{{
@@ -22,7 +24,6 @@ void beginRenderPass(gnCommandBuffer buffer, gnRenderPassInfo passInfo) {
.clearValueCount = passInfo.clearValueCount, .clearValueCount = passInfo.clearValueCount,
.pClearValues = values, .pClearValues = values,
}; };
vkCmdBeginRenderPass(buffer->commandBuffer->buffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE); vkCmdBeginRenderPass(buffer->commandBuffer->buffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
} }
void endRenderPass(gnCommandBuffer buffer) { void endRenderPass(gnCommandBuffer buffer) {

View File

@@ -44,6 +44,8 @@ VkAccessFlags vkGryphnRenderPassAccess(gnRenderPassAccess access) {
} }
gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device, gnRenderPassDescriptorInfo info) { gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device, gnRenderPassDescriptorInfo info) {
renderPass->renderPassDescriptor = malloc(sizeof(gnPlatformRenderPassDescriptor)); renderPass->renderPassDescriptor = malloc(sizeof(gnPlatformRenderPassDescriptor));
renderPass->renderPassDescriptor->attachmentCount = info.attachmentCount; renderPass->renderPassDescriptor->attachmentCount = info.attachmentCount;
@@ -79,9 +81,7 @@ gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device
.attachment = info.subpassInfos[i].colorAttachments[c].index, .attachment = info.subpassInfos[i].colorAttachments[c].index,
.layout = vkGryphnImageLayout(info.subpassInfos[i].colorAttachments[c].imageLayout) .layout = vkGryphnImageLayout(info.subpassInfos[i].colorAttachments[c].imageLayout)
}; };
} if (info.subpassInfos[i].resolveAttachments != NULL)
for (int c = 0; c < info.subpassInfos[i].colorAttachmentCount; c++) {
renderPass->renderPassDescriptor->resolveAttachments[i][c] = (VkAttachmentReference){ renderPass->renderPassDescriptor->resolveAttachments[i][c] = (VkAttachmentReference){
.attachment = info.subpassInfos[i].resolveAttachments[c].index, .attachment = info.subpassInfos[i].resolveAttachments[c].index,
.layout = vkGryphnImageLayout(info.subpassInfos[i].resolveAttachments[c].imageLayout) .layout = vkGryphnImageLayout(info.subpassInfos[i].resolveAttachments[c].imageLayout)
@@ -93,9 +93,11 @@ gnReturnCode createRenderPass(gnRenderPassDescriptor renderPass, gnDevice device
.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
.colorAttachmentCount = info.subpassInfos[i].colorAttachmentCount, .colorAttachmentCount = info.subpassInfos[i].colorAttachmentCount,
.pColorAttachments = renderPass->renderPassDescriptor->colorAttachments[i], .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) { if (info.subpassInfos[i].depthAttachment != NULL) {
renderPass->renderPassDescriptor->depthAttachments[i] = (VkAttachmentReference){ renderPass->renderPassDescriptor->depthAttachments[i] = (VkAttachmentReference){
.attachment = info.subpassInfos[i].depthAttachment->index, .attachment = info.subpassInfos[i].depthAttachment->index,

View File

@@ -24,6 +24,7 @@ typedef struct gnPhysicalDeviceProperties {
typedef struct gnPhysicalDeviceFeatures { typedef struct gnPhysicalDeviceFeatures {
gnMultisampleCountFlags avaliableSamples; gnMultisampleCountFlags avaliableSamples;
uint32_t maxMemoryAllocations;
} gnPhysicalDeviceFeatures; } gnPhysicalDeviceFeatures;
typedef enum gnQueueTypeFlags { typedef enum gnQueueTypeFlags {