uniform pool

This commit is contained in:
Greg Wells
2025-06-08 09:49:48 -04:00
parent 1825a39946
commit 292187b494
15 changed files with 93 additions and 19 deletions

View File

@@ -8,8 +8,9 @@ typedef enum gnIndexType {
} gnIndexType;
typedef enum gnBufferType {
GN_VERTEX_BUFFER = 0x00000001f,
GN_INDEX_BUFFER = 0x00000002f,
GN_VERTEX_BUFFER = 0x00000001,
GN_INDEX_BUFFER = 0x00000002,
GN_UNIFORM_BUFFER = 0x00000004
} gnBufferType;
typedef enum gnBufferUsage {

View File

@@ -24,3 +24,4 @@ GN_HANDLE(gnSemaphore);
GN_HANDLE(gnFence);
GN_HANDLE(gnFramebuffer);
GN_HANDLE(gnBuffer);
GN_HANDLE(gnUniformPool);

View File

@@ -87,6 +87,8 @@ typedef struct gnDeviceFunctions_t {
void* (*_gnMapBuffer)(gnBufferHandle buffer);
void (*_gnDestroyBuffer)(gnBufferHandle buffer);
gnReturnCode (*_gnCreateUniformPool)(gnUniformPool pool, gnDeviceHandle device);
gnReturnCode (*_gnCreateFence)(gnFenceHandle fence, gnOutputDeviceHandle device);
void (*_gnSignalFence)(gnFenceHandle fence);
void (*_gnWaitForFence)(gnFenceHandle fence, uint64_t timeout);

View File

@@ -88,6 +88,7 @@ void gnLoadDeviceFunctions(struct gnDynamicLibrary_t* lib, struct gnDeviceFuncti
gnLoadDLLFunction(lib, functions->_gnBufferData, "gnBufferDataFn");
gnLoadDLLFunction(lib, functions->_gnMapBuffer, "gnMapBufferFn");
gnLoadDLLFunction(lib, functions->_gnDestroyBuffer, "gnDestroyBufferFn");
gnLoadDLLFunction(lib, functions->_gnCreateUniformPool, "gnCreateUniformPoolFn");
gnLoadDLLFunction(lib, functions->_gnCreateFence, "gnCreateFenceFn");
gnLoadDLLFunction(lib, functions->_gnSignalFence, "gnSignalFenceFn");
gnLoadDLLFunction(lib, functions->_gnWaitForFence, "gnWaitForFenceFn");

View File

@@ -1,6 +1,6 @@
#pragma once
#include <core/output_device/gryphn_output_device.h>
#include <core/pipelines/gryphn_uniform_layout.h>
#include <core/uniforms/gryphn_uniform_layout.h>
#include <core/renderpass/gryphn_render_pass_descriptor.h>
#include <core/shader_module/gryphn_shader_module.h>
#include "utils/math/gryphn_vec2.h"

View File

@@ -0,0 +1,7 @@
// #pragma once
// #ifdef GN_REVEAL_IMPL
// struct gnUniform_t {
// };
// #endif

View File

@@ -3,7 +3,7 @@
#include "core/shader_module/gryphn_shader_module.h"
typedef enum gnUniformType {
GN_UNIFORM_BUFFER
GN_UNIFORM_BUFFER_DESCRIPTOR
} gnUniformType;
typedef struct gnUniformBinding {

View File

@@ -0,0 +1,10 @@
#include "gryphn_uniform_pool.h"
#include "core/output_device/gryphn_output_device.h"
#include "core/gryphn_platform_functions.h"
#include "stdlib.h"
gnReturnCode gnCreateUniformPool(gnUniformPool* pool, gnDeviceHandle device) {
*pool = malloc(sizeof(struct gnUniformPool_t));
(*pool)->device = device;
return device->deviceFunctions->_gnCreateUniformPool(*pool, device);
}

View File

@@ -0,0 +1,13 @@
#pragma once
#include "core/gryphn_handles.h"
#include "utils/gryphn_error_code.h"
#ifdef GN_REVEAL_IMPL
struct gnUniformPool_t {
struct gnPlatformUniformPool_t* uniformPool;
gnDeviceHandle device;
};
#endif
gnReturnCode gnCreateUniformPool(gnUniformPool* pool, gnDeviceHandle device);
// void gnUniformPoolAllocateUniforms