diff --git a/projects/apis/vulkan/src/commands/commands/vulkan_commands.c b/projects/apis/vulkan/src/commands/commands/vulkan_commands.c index 7a1feea..1186d18 100644 --- a/projects/apis/vulkan/src/commands/commands/vulkan_commands.c +++ b/projects/apis/vulkan/src/commands/commands/vulkan_commands.c @@ -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) { diff --git a/projects/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.c b/projects/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.c index ea0c482..23928e4 100644 --- a/projects/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.c +++ b/projects/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.c @@ -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, diff --git a/projects/core/src/output_device/gryphn_physical_output_device.h b/projects/core/src/output_device/gryphn_physical_output_device.h index fb3fba0..9934e3d 100644 --- a/projects/core/src/output_device/gryphn_physical_output_device.h +++ b/projects/core/src/output_device/gryphn_physical_output_device.h @@ -24,6 +24,7 @@ typedef struct gnPhysicalDeviceProperties { typedef struct gnPhysicalDeviceFeatures { gnMultisampleCountFlags avaliableSamples; + uint32_t maxMemoryAllocations; } gnPhysicalDeviceFeatures; typedef enum gnQueueTypeFlags {