clean up buffer creation

This commit is contained in:
Greg Wells
2025-06-08 17:25:08 -04:00
parent 93d81966e3
commit ffdde93ed2
11 changed files with 72 additions and 42 deletions

View File

@@ -1,4 +1,6 @@
#include "gryphn_command.h"
#include "core/command/command_buffer/gryphn_command_buffer.h"
#include "core/command/command_pool/gryphn_command_pool.h"
#include "core/gryphn_platform_functions.h"
void gnCommandBeginRenderPass(struct gnCommandBuffer_t* buffer, struct gnRenderPassInfo_t passInfo) {

View File

@@ -12,14 +12,12 @@
#include "pipelines/graphics_pipeline/gryphn_graphics_pipeline.h"
#include "framebuffer/gryphn_framebuffer.h"
#include "command/command_pool/gryphn_command_pool.h"
#include "command/command_buffer/gryphn_command_buffer.h"
#include "renderpass/gryphn_render_pass.h"
#include "sync/fence/gryphn_fence.h"
#include "sync/semaphore/gryphn_semaphore.h"
#include "core/submit/gryphn_submit.h"
#include "core/present/gryphn_present.h"
#include "core/buffers/gryphn_buffer.h"
#include "core/uniforms/gryphn_uniform.h"
#include "core/textures/gryphn_texture.h"
typedef struct gnFunctions_t {
gnReturnCode (*_gnCreateInstance)(gnInstanceHandle instance, gnInstanceInfo info);
@@ -94,6 +92,8 @@ typedef struct gnDeviceFunctions_t {
void (*_gnUpdateBufferUniform)(gnUniform uniform, gnBufferUniformInfo* bufferInfo);
gnReturnCode (*_gnCreateTexture)(gnTexture texture, gnDevice device, const gnTextureInfo info);
gnReturnCode (*_gnCreateFence)(gnFenceHandle fence, gnOutputDeviceHandle device);
void (*_gnSignalFence)(gnFenceHandle fence);
void (*_gnWaitForFence)(gnFenceHandle fence, uint64_t timeout);

View File

@@ -93,6 +93,7 @@ void gnLoadDeviceFunctions(struct gnDynamicLibrary_t* lib, struct gnDeviceFuncti
gnLoadDLLFunction(lib, functions->_gnUniformPoolAllocateUniforms, "gnUniformPoolAllocateUniformsFn");
gnLoadDLLFunction(lib, functions->_gnDestroyUniformPool, "gnDestroyUniformPoolFn");
gnLoadDLLFunction(lib, functions->_gnUpdateBufferUniform, "gnUpdateBufferUniformFn");
gnLoadDLLFunction(lib, functions->_gnCreateTexture, "gnCreateTextureFn");
gnLoadDLLFunction(lib, functions->_gnCreateFence, "gnCreateFenceFn");
gnLoadDLLFunction(lib, functions->_gnSignalFence, "gnSignalFenceFn");
gnLoadDLLFunction(lib, functions->_gnWaitForFence, "gnWaitForFenceFn");

View File

@@ -21,20 +21,20 @@ typedef enum gnStoreOperation_e {
} gnStoreOperation;
typedef struct gnRenderPassAttachmentInfo_t {
enum gnImageFormat_e format;
enum gnLoadOperation_e loadOperation;
enum gnStoreOperation_e storeOperation;
gnImageFormat format;
gnLoadOperation loadOperation;
gnStoreOperation storeOperation;
enum gnLoadOperation_e stencilLoadOperation;
enum gnStoreOperation_e stencilStoreOperation;
gnLoadOperation stencilLoadOperation;
gnStoreOperation stencilStoreOperation;
enum gnImageLayout_e initialLayout;
enum gnImageLayout_e finalLayout;
gnImageLayout initialLayout;
gnImageLayout finalLayout;
} gnRenderPassAttachmentInfo;
typedef struct gnSubpassAttachmentInfo_t {
uint32_t index;
enum gnImageLayout_e imageLayout;
gnImageLayout imageLayout;
} gnSubpassAttachmentInfo;
typedef struct gnSubpassInfo_t {

View File

@@ -1,7 +1,26 @@
#pragma once
#include "stdint.h"
#include "stdlib.h"
#include "utils/gryphn_image_format.h"
#include "utils/gryphn_error_code.h"
#include <core/gryphn_handles.h>
typedef enum gnTextureType {
GN_TEXTURE_2D
} gnTextureType;
typedef struct gnTextureInfo {
uint32_t width;
uint32_t height;
gnTextureType type;
gnImageFormat format;
} gnTextureInfo;
#ifdef GN_REVEAL_IMPL
struct gnTexture_t {
struct gnPlatformTexture_t* texture;
gnDeviceHandle device;
};
#endif
gnReturnCode gnCreateTexture(gnTexture* texture, gnDevice device, const gnTextureInfo info);