diff --git a/rendering_api/metal/src/core/devices/metal_output_device.m b/rendering_api/metal/src/core/devices/metal_output_device.m index 12c25cf..421333c 100644 --- a/rendering_api/metal/src/core/devices/metal_output_device.m +++ b/rendering_api/metal/src/core/devices/metal_output_device.m @@ -8,11 +8,12 @@ gnReturnCode gnCreateOutputDeviceFn(gnOutputDeviceHandle outputDevice, gnInstanceHandle instance, struct gnOutputDeviceInfo_t deviceInfo) { outputDevice->outputDevice = malloc(sizeof(gnPlatformOutputDevice)); outputDevice->outputDevice->device = deviceInfo.physicalDevice.physicalDevice->device.retain; - outputDevice->outputDevice->queueCount = deviceInfo.queueInfoCount; - outputDevice->outputDevice->queues = malloc(sizeof(id) * deviceInfo.queueInfoCount); - for (int i = 0; i < deviceInfo.queueInfoCount; i++) { - outputDevice->outputDevice->queues[i] = outputDevice->outputDevice->device.newCommandQueue; - } + outputDevice->outputDevice->transferQueue = outputDevice->outputDevice->device.newCommandQueue; + // outputDevice->outputDevice->queueCount = deviceInfo.queueInfoCount; + // outputDevice->outputDevice->queues = malloc(sizeof(id) * deviceInfo.queueInfoCount); + // for (int i = 0; i < deviceInfo.queueInfoCount; i++) { + // outputDevice->outputDevice->queues[i] = outputDevice->outputDevice->device.newCommandQueue; + // } return GN_SUCCESS; } @@ -22,9 +23,10 @@ void gnWaitForDeviceFn(gnOutputDeviceHandle device) { } void gnDestroyOutputDeviceFn(gnOutputDeviceHandle device) { - for (int i = 0; i < device->outputDevice->queueCount; i++) { - [device->outputDevice->queues[i] release]; - } + // for (int i = 0; i < device->outputDevice->queueCount; i++) { + // [device->outputDevice->queues[i] release]; + // } + [device->outputDevice->transferQueue release]; [device->outputDevice->device release]; free(device->outputDevice); } diff --git a/rendering_api/metal/src/core/devices/metal_output_devices.h b/rendering_api/metal/src/core/devices/metal_output_devices.h index 967b254..4348b92 100644 --- a/rendering_api/metal/src/core/devices/metal_output_devices.h +++ b/rendering_api/metal/src/core/devices/metal_output_devices.h @@ -12,10 +12,7 @@ struct gnPlatformOutputDevice_t { id device; MTKView* contentView; - int queueCount; - id* queues; - id executingCommandBuffer; - - id framebuffer; + id transferQueue; + // id framebuffer; } gnPlatformOutputDevice; diff --git a/rendering_api/metal/src/core/present/metal_present.m b/rendering_api/metal/src/core/present/metal_present.m index 8bd33e9..247589b 100644 --- a/rendering_api/metal/src/core/present/metal_present.m +++ b/rendering_api/metal/src/core/present/metal_present.m @@ -20,7 +20,7 @@ gnReturnCode gnPresentFn(gnOutputDeviceHandle device, struct gnPresentInfo_t inf return GN_FAILED_TO_CREATE_FRAMEBUFFER; } - id commandBuffer = [device->outputDevice->queues[info.queueIndex] commandBuffer]; + id commandBuffer = [device->outputDevice->transferQueue commandBuffer]; MTLRenderPassDescriptor* passDesc = [MTLRenderPassDescriptor renderPassDescriptor]; passDesc.colorAttachments[0].texture = drawable.texture;