only load device functions once per instance

This commit is contained in:
Greg Wells
2025-05-29 14:04:18 -04:00
parent 3f776277cd
commit 088d5a2adf
4 changed files with 12 additions and 3 deletions

View File

@@ -5,6 +5,7 @@
gnReturnCode gnCreateInstance(gnInstance* instance, struct gnInstanceInfo_t info) {
if (!gnIsAPISupported(info.renderingAPI)) return GN_UNSUPPORTED_RENDERING_API;
instance->loadDeviceFunctions = gnFalse;
instance->debugger = NULL;
instance->dynamicLib = gnLoadRenderingDLL(info.renderingAPI);
if (instance->dynamicLib == NULL) return GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY;

View File

@@ -19,9 +19,10 @@ typedef struct gnInstanceInfo_t {
typedef struct gnInstance_t {
struct gnPlatformInstance_t* instance;
gnBool valid;
gnBool valid, loadDeviceFunctions;
struct gnFunctions_t* functions;
struct gnDeviceFunctions_t* deviceFunctions;
struct gnDynamicLibrary_t* dynamicLib;
struct gnDebugger_t* debugger;