Render pass descriptor handles
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "core/framebuffer/gryphn_framebuffer.h"
|
#include "core/framebuffer/gryphn_framebuffer.h"
|
||||||
|
#include "utils/gryphn_bool.h"
|
||||||
|
#include "utils/types/gryphn_image_format.h"
|
||||||
#import <Metal/Metal.h>
|
#import <Metal/Metal.h>
|
||||||
#import <Metal/MTLRenderPass.h>
|
#import <Metal/MTLRenderPass.h>
|
||||||
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
#include "metal_framebuffer.h"
|
#include "metal_framebuffer.h"
|
||||||
#include "core/debugger/gryphn_debugger.h"
|
#include "core/debugger/gryphn_debugger.h"
|
||||||
#include "core/texture/metal_texture.h"
|
#include "core/texture/metal_texture.h"
|
||||||
|
#include "core/renderpass/gryphn_render_pass_descriptor.h"
|
||||||
|
|
||||||
gnBool isDepthFormat(gnImageFormat format) {
|
gnBool isDepthFormat(gnImageFormat format) {
|
||||||
return gnFalse;
|
return gnFalse;
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "core/renderpass/gryphn_render_pass_descriptor.h"
|
|
||||||
#include "utils/math/gryphn_vec2.h"
|
#include "utils/math/gryphn_vec2.h"
|
||||||
|
#include "utils/gryphn_error_code.h"
|
||||||
|
#include "core/gryphn_handles.h"
|
||||||
|
|
||||||
typedef struct gnFramebufferInfo_t {
|
typedef struct gnFramebufferInfo_t {
|
||||||
struct gnRenderPassDescriptor_t* renderPassDescriptor;
|
gnRenderPassDescriptorHandle renderPassDescriptor;
|
||||||
uint32_t attachmentCount;
|
uint32_t attachmentCount;
|
||||||
gnTextureHandle* attachments;
|
gnTextureHandle* attachments;
|
||||||
gnUInt2 size;
|
gnUInt2 size;
|
||||||
@@ -11,8 +12,8 @@ typedef struct gnFramebufferInfo_t {
|
|||||||
|
|
||||||
typedef struct gnFramebuffer_t {
|
typedef struct gnFramebuffer_t {
|
||||||
struct gnPlatformFramebuffer_t* framebuffer;
|
struct gnPlatformFramebuffer_t* framebuffer;
|
||||||
struct gnOutputDevice_t* device;
|
gnOutputDeviceHandle device;
|
||||||
} gnFramebuffer;
|
} gnFramebuffer;
|
||||||
|
|
||||||
gnReturnCode gnCreateFramebuffer(struct gnFramebuffer_t* framebuffer, struct gnOutputDevice_t* device, struct gnFramebufferInfo_t framebufferInfo);
|
gnReturnCode gnCreateFramebuffer(struct gnFramebuffer_t* framebuffer, gnOutputDeviceHandle device, struct gnFramebufferInfo_t framebufferInfo);
|
||||||
void gnDestroyFramebuffer(struct gnFramebuffer_t* framebuffer);
|
void gnDestroyFramebuffer(struct gnFramebuffer_t* framebuffer);
|
||||||
|
@@ -9,3 +9,5 @@ GN_HANDLE(gnDebugger);
|
|||||||
GN_HANDLE(gnWindowSurface);
|
GN_HANDLE(gnWindowSurface);
|
||||||
GN_HANDLE(gnPresentationQueue);
|
GN_HANDLE(gnPresentationQueue);
|
||||||
GN_HANDLE(gnTexture);
|
GN_HANDLE(gnTexture);
|
||||||
|
GN_HANDLE(gnRenderPassDescriptor);
|
||||||
|
GN_HANDLE(gnOutputDevice);
|
||||||
|
@@ -66,8 +66,8 @@ typedef struct gnDeviceFunctions_t {
|
|||||||
gnReturnCode (*_gnCreateShaderModule)(struct gnShaderModule_t* module, gnOutputDeviceHandle device, struct gnShaderModuleInfo_t shaderModuleInfo);
|
gnReturnCode (*_gnCreateShaderModule)(struct gnShaderModule_t* module, gnOutputDeviceHandle device, struct gnShaderModuleInfo_t shaderModuleInfo);
|
||||||
void (*_gnDestroyShaderModule)(struct gnShaderModule_t* module);
|
void (*_gnDestroyShaderModule)(struct gnShaderModule_t* module);
|
||||||
|
|
||||||
gnReturnCode (*_gnCreateRenderPassDescriptor)(struct gnRenderPassDescriptor_t* renderPass, gnOutputDeviceHandle device, struct gnRenderPassDescriptorInfo_t info);
|
gnReturnCode (*_gnCreateRenderPassDescriptor)(gnRenderPassDescriptorHandle renderPass, gnOutputDeviceHandle device, struct gnRenderPassDescriptorInfo_t info);
|
||||||
void (*_gnDestroyRenderPassDescriptor)(struct gnRenderPassDescriptor_t* renderPass);
|
void (*_gnDestroyRenderPassDescriptor)(gnRenderPassDescriptorHandle renderPass);
|
||||||
|
|
||||||
gnReturnCode (*_gnCreateGraphicsPipeline)(struct gnGraphicsPipeline_t* pipeline, gnOutputDeviceHandle device, struct gnGraphicsPipelineInfo_t pipelineInfo);
|
gnReturnCode (*_gnCreateGraphicsPipeline)(struct gnGraphicsPipeline_t* pipeline, gnOutputDeviceHandle device, struct gnGraphicsPipelineInfo_t pipelineInfo);
|
||||||
void (*_gnDestroyGraphicsPipeline)(struct gnGraphicsPipeline_t* pipeline);
|
void (*_gnDestroyGraphicsPipeline)(struct gnGraphicsPipeline_t* pipeline);
|
||||||
|
@@ -27,8 +27,6 @@ struct gnOutputDevice_t {
|
|||||||
gnPhysicalDevice physicalDevice;
|
gnPhysicalDevice physicalDevice;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
typedef struct gnOutputDevice_t* gnOutputDeviceHandle;
|
|
||||||
typedef gnOutputDeviceHandle gnOutputDevice;
|
|
||||||
|
|
||||||
gnReturnCode gnCreateOutputDevice(gnOutputDeviceHandle* outputDevice, gnInstanceHandle instance, struct gnOutputDeviceInfo_t deviceInfo);
|
gnReturnCode gnCreateOutputDevice(gnOutputDeviceHandle* outputDevice, gnInstanceHandle instance, struct gnOutputDeviceInfo_t deviceInfo);
|
||||||
void gnWaitForDevice(gnOutputDeviceHandle device);
|
void gnWaitForDevice(gnOutputDeviceHandle device);
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "gryphn_render_pass_descriptor.h"
|
|
||||||
#include "core/framebuffer/gryphn_framebuffer.h"
|
#include "core/framebuffer/gryphn_framebuffer.h"
|
||||||
#include "utils/types/gryphn_color.h"
|
#include "utils/types/gryphn_color.h"
|
||||||
|
|
||||||
typedef struct gnRenderPassInfo_t {
|
typedef struct gnRenderPassInfo_t {
|
||||||
struct gnRenderPassDescriptor_t* renderPassDescriptor;
|
gnRenderPassDescriptorHandle renderPassDescriptor;
|
||||||
struct gnFramebuffer_t* framebuffer;
|
struct gnFramebuffer_t* framebuffer;
|
||||||
gnUInt2 offset;
|
gnUInt2 offset;
|
||||||
gnUInt2 size;
|
gnUInt2 size;
|
||||||
|
@@ -1,12 +1,14 @@
|
|||||||
#include "gryphn_render_pass_descriptor.h"
|
#include "gryphn_render_pass_descriptor.h"
|
||||||
#include "core/gryphn_platform_functions.h"
|
#include "core/gryphn_platform_functions.h"
|
||||||
|
|
||||||
gnReturnCode gnCreateRenderPassDescriptor(struct gnRenderPassDescriptor_t* renderPass, struct gnOutputDevice_t* device, struct gnRenderPassDescriptorInfo_t info) {
|
gnReturnCode gnCreateRenderPassDescriptor(gnRenderPassDescriptorHandle* renderPass, gnOutputDeviceHandle device, struct gnRenderPassDescriptorInfo_t info) {
|
||||||
renderPass->device = device;
|
*renderPass = malloc(sizeof(struct gnRenderPassDescriptor_t));
|
||||||
renderPass->info = info;
|
|
||||||
return device->deviceFunctions->_gnCreateRenderPassDescriptor(renderPass, device, info);
|
(*renderPass)->device = device;
|
||||||
|
(*renderPass)->info = info;
|
||||||
|
return device->deviceFunctions->_gnCreateRenderPassDescriptor(*renderPass, device, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gnDestroyRenderPassDescriptor(struct gnRenderPassDescriptor_t* renderPass) {
|
void gnDestroyRenderPassDescriptor(gnRenderPassDescriptorHandle renderPass) {
|
||||||
renderPass->device->deviceFunctions->_gnDestroyRenderPassDescriptor(renderPass);
|
renderPass->device->deviceFunctions->_gnDestroyRenderPassDescriptor(renderPass);
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#include "utils/types/gryphn_image_format.h"
|
#include "utils/types/gryphn_image_format.h"
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "core/output_device/gryphn_output_device.h"
|
#include "core/output_device/gryphn_output_device.h"
|
||||||
|
#include "core/gryphn_handles.h"
|
||||||
|
|
||||||
typedef enum gnRenderPassStage_e {
|
typedef enum gnRenderPassStage_e {
|
||||||
GN_COLOR_ATTACHMENT_OUTPUT = 0x00000400
|
GN_COLOR_ATTACHMENT_OUTPUT = 0x00000400
|
||||||
@@ -64,13 +65,13 @@ typedef struct gnRenderPassDescriptorInfo_t {
|
|||||||
struct gnSubpassDependencyInfo_t* dependencies;
|
struct gnSubpassDependencyInfo_t* dependencies;
|
||||||
} gnRenderPassDescriptorInfo;
|
} gnRenderPassDescriptorInfo;
|
||||||
|
|
||||||
struct gnPlatformRenderPassDescriptor_t;
|
#ifdef GN_REVEAL_IMPL
|
||||||
|
struct gnRenderPassDescriptor_t {
|
||||||
typedef struct gnRenderPassDescriptor_t {
|
|
||||||
struct gnPlatformRenderPassDescriptor_t* renderPassDescriptor;
|
struct gnPlatformRenderPassDescriptor_t* renderPassDescriptor;
|
||||||
struct gnRenderPassDescriptorInfo_t info;
|
struct gnRenderPassDescriptorInfo_t info;
|
||||||
struct gnOutputDevice_t* device;
|
struct gnOutputDevice_t* device;
|
||||||
} gnRenderPassDescriptor;
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
gnReturnCode gnCreateRenderPassDescriptor(struct gnRenderPassDescriptor_t* renderPass, struct gnOutputDevice_t* device, struct gnRenderPassDescriptorInfo_t info);
|
gnReturnCode gnCreateRenderPassDescriptor(gnRenderPassDescriptorHandle* renderPass, gnOutputDeviceHandle device, struct gnRenderPassDescriptorInfo_t info);
|
||||||
void gnDestroyRenderPassDescriptor(struct gnRenderPassDescriptor_t* renderPass);
|
void gnDestroyRenderPassDescriptor(gnRenderPassDescriptorHandle renderPass);
|
||||||
|
Reference in New Issue
Block a user