uniform pool
This commit is contained in:
@@ -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 {
|
||||
|
@@ -24,3 +24,4 @@ GN_HANDLE(gnSemaphore);
|
||||
GN_HANDLE(gnFence);
|
||||
GN_HANDLE(gnFramebuffer);
|
||||
GN_HANDLE(gnBuffer);
|
||||
GN_HANDLE(gnUniformPool);
|
||||
|
@@ -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);
|
||||
|
@@ -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");
|
||||
|
@@ -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"
|
||||
|
7
src/core/uniforms/gryphn_uniform.h
Normal file
7
src/core/uniforms/gryphn_uniform.h
Normal file
@@ -0,0 +1,7 @@
|
||||
// #pragma once
|
||||
|
||||
// #ifdef GN_REVEAL_IMPL
|
||||
// struct gnUniform_t {
|
||||
|
||||
// };
|
||||
// #endif
|
@@ -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 {
|
10
src/core/uniforms/gryphn_uniform_pool.c
Normal file
10
src/core/uniforms/gryphn_uniform_pool.c
Normal 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);
|
||||
}
|
13
src/core/uniforms/gryphn_uniform_pool.h
Normal file
13
src/core/uniforms/gryphn_uniform_pool.h
Normal 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
|
Reference in New Issue
Block a user