get all the commands to work
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
#include "metal_loader.h"
|
||||
#include "commands/command_buffer/metal_command_buffer.h"
|
||||
#include "commands/commands/metal_commands.h"
|
||||
|
||||
gnCommandFunctions loadMetalCommandFunctions() {
|
||||
return (gnCommandFunctions){
|
||||
._gnCommandPoolAllocateCommandBuffers = NULL,
|
||||
._gnBeginCommandBuffer = NULL,
|
||||
._gnResetCommandBuffer = NULL,
|
||||
._gnEndCommandBuffer = NULL,
|
||||
._gnCommandPoolAllocateCommandBuffers = allocateMetalCommandBuffers,
|
||||
._gnBeginCommandBuffer = beginMetalCommandBuffer,
|
||||
._gnResetCommandBuffer = resetMetalCommandBuffer,
|
||||
._gnEndCommandBuffer = endMetalCommandBuffer,
|
||||
|
||||
._gnCommandBeginRenderPass = NULL,
|
||||
._gnCommandEndRenderPass = NULL,
|
||||
._gnCommandBindGraphicsPipeline = NULL,
|
||||
._gnCommandSetViewport = NULL,
|
||||
._gnCommandSetScissor = NULL,
|
||||
._gnCommandBindUniform = NULL,
|
||||
._gnCommandPushConstant = NULL,
|
||||
._gnCommandBeginRenderPass = metelBeginRenderPass,
|
||||
._gnCommandEndRenderPass = endMetalRenderPass,
|
||||
._gnCommandBindGraphicsPipeline = bindMetalGraphicsPipeline,
|
||||
._gnCommandSetViewport = setMetalViewport,
|
||||
._gnCommandSetScissor = setMetalScissor,
|
||||
._gnCommandBindUniform = metalBindUniform,
|
||||
._gnCommandPushConstant = metalBindVertexBytes,
|
||||
|
||||
._gnCommandBindBuffer = NULL,
|
||||
._gnCommandDraw = NULL,
|
||||
._gnCommandDrawIndexed = NULL,
|
||||
._gnCommandBindBuffer = bindMetalBuffer,
|
||||
._gnCommandDraw = metalDraw,
|
||||
._gnCommandDrawIndexed = metalDrawIndexed,
|
||||
};
|
||||
}
|
||||
|
@@ -1,53 +1,67 @@
|
||||
#include "metal_loader.h"
|
||||
#include "presentation_queue/metal_presentation_queue.h"
|
||||
#include "shader_module/metal_shader_module.h"
|
||||
#include "renderpass/metal_render_pass.h"
|
||||
#include "framebuffers/metal_framebuffer.h"
|
||||
#include "uniforms/metal_uniform_pool.h"
|
||||
#include "pipelines/graphics_pipeline/metal_graphics_pipeline.h"
|
||||
#include "texture/metal_texture.h"
|
||||
#include "commands/command_pool/metal_command_pool.h"
|
||||
#include "buffer/metal_buffer.h"
|
||||
#include "uniforms/metal_uniform.h"
|
||||
#include "sync/semaphore/metal_semaphore.h"
|
||||
#include "sync/fence/metal_fence.h"
|
||||
#include "submit/metal_submit.h"
|
||||
#include "present/metal_present.h"
|
||||
|
||||
gnDeviceFunctions loadMetalDeviceFunctions() {
|
||||
return (gnDeviceFunctions){
|
||||
._gnCreatePresentationQueue = NULL,
|
||||
._gnPresentationQueueGetImage = NULL,
|
||||
._gnDestroyPresentationQueue = NULL,
|
||||
._gnCreatePresentationQueue = createMetalPresentationQueue,
|
||||
._gnPresentationQueueGetImage = getMetalPresentQueueImage,
|
||||
._gnDestroyPresentationQueue = destroyMetalPresentationQueue,
|
||||
|
||||
._gnCreateShaderModule = NULL,
|
||||
._gnDestroyShaderModule = NULL,
|
||||
._gnCreateShaderModule = createMetalShaderModule,
|
||||
._gnDestroyShaderModule = destroyMetalShaderModule,
|
||||
|
||||
._gnCreateRenderPassDescriptor = NULL,
|
||||
._gnDestroyRenderPassDescriptor = NULL,
|
||||
._gnCreateRenderPassDescriptor = createMetalRenderPass,
|
||||
._gnDestroyRenderPassDescriptor = destroyMetalRenderPass,
|
||||
|
||||
._gnCreateGraphicsPipeline = NULL,
|
||||
._gnDestroyGraphicsPipeline = NULL,
|
||||
._gnCreateGraphicsPipeline = createMetalGraphicsPipeline,
|
||||
._gnDestroyGraphicsPipeline = destroyMetalGraphicsPipeline,
|
||||
|
||||
._gnCreateFramebuffer = NULL,
|
||||
._gnDestroyFramebuffer = NULL,
|
||||
._gnCreateFramebuffer = createMetalFramebuffer,
|
||||
._gnDestroyFramebuffer = destroyMetalFramebuffer,
|
||||
|
||||
._gnCreateCommandPool = NULL,
|
||||
._gnDestroyCommandPool = NULL,
|
||||
._gnCreateCommandPool = createMetalCommandPool,
|
||||
._gnDestroyCommandPool = destroyMetalCommandPool,
|
||||
|
||||
._gnCreateSemaphore = NULL,
|
||||
._gnDestroySemaphore = NULL,
|
||||
._gnCreateSemaphore = createMetalSemaphore,
|
||||
._gnDestroySemaphore = destroyMetalSemaphore,
|
||||
|
||||
._gnCreateBuffer = NULL,
|
||||
._gnBufferData = NULL,
|
||||
._gnMapBuffer = NULL,
|
||||
._gnDestroyBuffer = NULL,
|
||||
._gnCreateBuffer = createMetalBuffer,
|
||||
._gnBufferData = metalBufferData,
|
||||
._gnMapBuffer = mapMetalBuffer,
|
||||
._gnDestroyBuffer = destroyMetalBuffer,
|
||||
|
||||
._gnCreateUniformPool = NULL,
|
||||
._gnUniformPoolAllocateUniforms = NULL,
|
||||
._gnDestroyUniformPool = NULL,
|
||||
._gnCreateUniformPool = createMetalUniformPool,
|
||||
._gnUniformPoolAllocateUniforms = allocateMetalUniforms,
|
||||
._gnDestroyUniformPool = destroyMetalUniformPool,
|
||||
|
||||
._gnUpdateBufferUniform = NULL,
|
||||
._gnUpdateImageUniform = NULL,
|
||||
._gnUpdateBufferUniform = updateMetalBufferUniform,
|
||||
._gnUpdateImageUniform = updateMetalImageUniform,
|
||||
|
||||
._gnCreateTexture = NULL,
|
||||
._gnTextureData = NULL,
|
||||
._gnDestroyTexture = NULL,
|
||||
._gnCreateTexture = createMetalTexture,
|
||||
._gnTextureData = metalTextureData,
|
||||
._gnDestroyTexture = metalDestroyTexture,
|
||||
|
||||
._gnCreateFence = NULL,
|
||||
._gnWaitForFence = NULL,
|
||||
._gnResetFence = NULL,
|
||||
._gnDestroyFence = NULL,
|
||||
._gnCreateFence = createMetalFence,
|
||||
._gnWaitForFence = waitForMetalFence,
|
||||
._gnResetFence = resetMetalFence,
|
||||
._gnDestroyFence = destroyMetalFence,
|
||||
|
||||
._gnSubmit = NULL,
|
||||
._gnPresent = NULL,
|
||||
._gnSubmit = metalSubmit,
|
||||
._gnPresent = metalPresent,
|
||||
|
||||
._gnWaitForDevice = NULL
|
||||
._gnWaitForDevice = waitForMetalDevice
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user