command pool+buffer handles
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
#include "core/commands/command_pool/metal_command_pool.h"
|
||||
#import <Metal/Metal.h>
|
||||
|
||||
gnReturnCode gnCommandPoolAllocateCommandBuffersFn(struct gnCommandBuffer_t* commandBuffers, uint32_t count, struct gnCommandPool_t* pool) {
|
||||
gnReturnCode gnCommandPoolAllocateCommandBuffersFn(gnCommandBufferHandle* commandBuffers, uint32_t count, struct gnCommandPool_t* pool) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
commandBuffers[i].commandBuffer = malloc(sizeof(gnPlatformCommandBuffer));
|
||||
commandBuffers[i]->commandBuffer = malloc(sizeof(gnPlatformCommandBuffer));
|
||||
}
|
||||
|
||||
return GN_SUCCESS;
|
||||
|
@@ -15,8 +15,8 @@ gnReturnCode gnSubmitFn(struct gnOutputDevice_t* device, struct gnSubmitInfo_t i
|
||||
__block gnFence* fenceToSignal = info.fence;
|
||||
|
||||
for (int i = 0; i < info.commandBufferCount; i++) {
|
||||
id<MTLCommandBuffer> commandBuffer = info.commandBuffers[i].commandBuffer->commandBuffer;
|
||||
[info.commandBuffers[i].commandBuffer->commandBuffer addCompletedHandler:^(id<MTLCommandBuffer> buffer) {
|
||||
id<MTLCommandBuffer> commandBuffer = info.commandBuffers[i]->commandBuffer->commandBuffer;
|
||||
[info.commandBuffers[i]->commandBuffer->commandBuffer addCompletedHandler:^(id<MTLCommandBuffer> buffer) {
|
||||
for (int c = 0; c < semsToSignalCount; c++) {
|
||||
semsToSignal[c].semaphore->eventTriggered = gnTrue;
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "commands/command_pool/vulkan_command_pool.h"
|
||||
#include "output_device/vulkan_output_devices.h"
|
||||
|
||||
gnReturnCode gnCommandPoolAllocateCommandBuffersFn(struct gnCommandBuffer_t* commandBuffers, uint32_t count, struct gnCommandPool_t* pool) {
|
||||
gnReturnCode gnCommandPoolAllocateCommandBuffersFn(gnCommandBufferHandle* commandBuffers, uint32_t count, struct gnCommandPool_t* pool) {
|
||||
VkCommandBufferAllocateInfo allocInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
|
||||
.commandPool = pool->commandPool->commandPool,
|
||||
@@ -16,8 +16,8 @@ gnReturnCode gnCommandPoolAllocateCommandBuffersFn(struct gnCommandBuffer_t* com
|
||||
return GN_FAILED_TO_ALLOCATE_COMMAND_BUFFERS;
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
commandBuffers[i].commandBuffer = malloc(sizeof(gnPlatformCommandBuffer));
|
||||
commandBuffers[i].commandBuffer->buffer = buffers[i];
|
||||
commandBuffers[i]->commandBuffer = malloc(sizeof(gnPlatformCommandBuffer));
|
||||
commandBuffers[i]->commandBuffer->buffer = buffers[i];
|
||||
}
|
||||
|
||||
return GN_SUCCESS;
|
||||
|
@@ -21,7 +21,7 @@ gnReturnCode gnSubmitFn(struct gnOutputDevice_t* device, struct gnSubmitInfo_t i
|
||||
for (int i = 0; i < info.waitCount; i++) waitStages[i] = vkGryphnWaitStage(info.waitStages[i]);
|
||||
|
||||
VkCommandBuffer* commandBuffers = malloc(sizeof(VkCommandBuffer) * info.commandBufferCount);
|
||||
for (int i = 0; i < info.commandBufferCount; i++) commandBuffers[i] = info.commandBuffers[i].commandBuffer->buffer;
|
||||
for (int i = 0; i < info.commandBufferCount; i++) commandBuffers[i] = info.commandBuffers[i]->commandBuffer->buffer;
|
||||
|
||||
VkSemaphore* signalSemaphores = malloc(sizeof(VkSemaphore) * info.signalCount);
|
||||
for (int i = 0; i < info.signalCount; i++) signalSemaphores[i] = info.signalSemaphores[i].semaphore->semaphore;
|
||||
|
Reference in New Issue
Block a user