horrible uniform pool API

This commit is contained in:
Greg Wells
2025-06-08 13:40:40 -04:00
parent 92ba48005f
commit 04808a14dd
13 changed files with 112 additions and 48 deletions

View File

@@ -25,3 +25,4 @@ GN_HANDLE(gnFence);
GN_HANDLE(gnFramebuffer);
GN_HANDLE(gnBuffer);
GN_HANDLE(gnUniformPool);
GN_HANDLE(gnUniform);

View File

@@ -88,6 +88,7 @@ typedef struct gnDeviceFunctions_t {
void (*_gnDestroyBuffer)(gnBufferHandle buffer);
gnReturnCode (*_gnCreateUniformPool)(gnUniformPool pool, gnDeviceHandle device);
gnUniform* (*_gnUniformPoolAllocateUniforms)(gnUniformPool pool, const gnUniformLayout layout);
gnReturnCode (*_gnCreateFence)(gnFenceHandle fence, gnOutputDeviceHandle device);
void (*_gnSignalFence)(gnFenceHandle fence);

View File

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

View File

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

View File

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

View File

@@ -8,3 +8,7 @@ gnReturnCode gnCreateUniformPool(gnUniformPool* pool, gnDeviceHandle device) {
(*pool)->device = device;
return device->deviceFunctions->_gnCreateUniformPool(*pool, device);
}
gnUniform* gnUniformPoolAllocateUniforms(gnUniformPool pool, const gnUniformLayout layout) {
return pool->device->deviceFunctions->_gnUniformPoolAllocateUniforms(pool, layout);
}

View File

@@ -1,6 +1,7 @@
#pragma once
#include "core/gryphn_handles.h"
#include "utils/gryphn_error_code.h"
#include "core/uniforms/gryphn_uniform_layout.h"
#ifdef GN_REVEAL_IMPL
struct gnUniformPool_t {
@@ -10,4 +11,4 @@ struct gnUniformPool_t {
#endif
gnReturnCode gnCreateUniformPool(gnUniformPool* pool, gnDeviceHandle device);
// void gnUniformPoolAllocateUniforms
gnUniform* gnUniformPoolAllocateUniforms(gnUniformPool pool, const gnUniformLayout layout);