submit command moved to sync extension
This commit is contained in:
@@ -52,7 +52,7 @@ gnDeviceFunctions loadVulkanDeviceFunctions() {
|
||||
._gnTextureData = textureData,
|
||||
._gnDestroyTexture = destroyTexture,
|
||||
|
||||
._gnSubmit = submit,
|
||||
._gnSubmit = vulkanSubmit,
|
||||
._gnPresent = present,
|
||||
|
||||
._gnWaitForDevice = waitForDevice
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#include <sync/semaphore/vulkan_semaphore.h>
|
||||
#include <sync/fence/vulkan_fence.h>
|
||||
#include "presentation_queue/vulkan_presentation_queue.h"
|
||||
#include "submit/vulkan_submit.h"
|
||||
|
||||
gnSyncExtFunctions loadVulkanSyncFunctions() {
|
||||
return (gnSyncExtFunctions){
|
||||
@@ -14,5 +15,7 @@ gnSyncExtFunctions loadVulkanSyncFunctions() {
|
||||
._gnWaitForFence = waitForFence,
|
||||
._gnResetFence = resetFence,
|
||||
._gnDestroyFence = destroyFence,
|
||||
|
||||
._gnSubmitSync = vulkanSubmitSync
|
||||
};
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#include "vulkan_submit.h"
|
||||
|
||||
|
||||
gnReturnCode submit(gnDevice device, gnSubmitInfo info) {
|
||||
gnReturnCode vulkanSubmitSync(gnDevice device, gnSubmitSyncInfo info) {
|
||||
VkSemaphore* waitSemaphores = malloc(sizeof(VkSemaphore) * info.waitCount);
|
||||
VkPipelineStageFlags* waitStages = malloc(sizeof(VkPipelineStageFlags) * info.waitCount);
|
||||
for (int i = 0; i < info.waitCount; i++) waitSemaphores[i] = info.waitSemaphores[i]->semaphore->semaphore;
|
||||
@@ -40,3 +39,26 @@ gnReturnCode submit(gnDevice device, gnSubmitInfo info) {
|
||||
free(signalSemaphores);
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
||||
gnReturnCode vulkanSubmit(gnDevice device, gnSubmitInfo info) {
|
||||
VkCommandBuffer* commandBuffers = malloc(sizeof(VkCommandBuffer) * info.commandBufferCount);
|
||||
for (int i = 0; i < info.commandBufferCount; i++) commandBuffers[i] = info.commandBuffers[i]->commandBuffer->buffer;
|
||||
|
||||
VkSubmitInfo submitInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
.waitSemaphoreCount = 0,
|
||||
.pWaitSemaphores = NULL,
|
||||
.pWaitDstStageMask = NULL,
|
||||
.commandBufferCount = info.commandBufferCount,
|
||||
.pCommandBuffers = commandBuffers,
|
||||
.signalSemaphoreCount = 0,
|
||||
.pSignalSemaphores = NULL
|
||||
};
|
||||
|
||||
VkQueue queue;
|
||||
vkGetDeviceQueue(device->outputDevice->device, info.queueIndex, 0, &queue);
|
||||
|
||||
if (vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE) != VK_SUCCESS)
|
||||
return GN_FAILED_TO_SUBMIT_COMMAND_BUFFER;
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
@@ -5,5 +5,7 @@
|
||||
#include <commands/command_buffer/vulkan_command_buffer.h>
|
||||
#include <output_device/vulkan_output_devices.h>
|
||||
#include <renderpass/vulkan_render_pass_descriptor.h>
|
||||
#include "extensions/synchronization/commands/gryphn_sync_submit.h"
|
||||
|
||||
gnReturnCode submit(gnDevice device, gnSubmitInfo info);
|
||||
gnReturnCode vulkanSubmitSync(gnDevice device, gnSubmitSyncInfo info);
|
||||
gnReturnCode vulkanSubmit(gnDevice device, gnSubmitInfo info);
|
||||
|
Reference in New Issue
Block a user