only load when GN_EXT_SYNCHRONIZATION is enabled

This commit is contained in:
Gregory Wells
2025-07-09 20:12:02 -04:00
parent 6e22c85e43
commit a6c05bfa52
3 changed files with 8 additions and 2 deletions

View File

@@ -15,6 +15,11 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceInfo info) {
.layerToLoad = api_layer .layerToLoad = api_layer
})); }));
// TODO: still needs to check to see if the extension is supported
for (int i = 0; i < info.extensionCount; i++) {
if (info.extensions[i] == GN_EXT_SYNCHRONIZATION) (*instance)->layers.data[0].syncFunctions = loadAPISyncFunctions(info.renderingAPI);
}
gnBool loaderFunctionChecker = gnFalse; gnBool loaderFunctionChecker = gnFalse;
for (int i = 0; i < info.debugger->info.layerCount; i++) { for (int i = 0; i < info.debugger->info.layerCount; i++) {
if (info.debugger->info.layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) loaderFunctionChecker = gnTrue; if (info.debugger->info.layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) loaderFunctionChecker = gnTrue;

View File

@@ -99,8 +99,6 @@ loaderLayer api_loaded_layer(gnRenderingAPI api) {
.instanceFunctions = loadAPIInstanceFunctions(api), .instanceFunctions = loadAPIInstanceFunctions(api),
.deviceFunctions = loadAPIDeviceFunctions(api), .deviceFunctions = loadAPIDeviceFunctions(api),
.commandFunctions = loadAPICommandFunctions(api), .commandFunctions = loadAPICommandFunctions(api),
.syncFunctions = loadAPISyncFunctions(api)
}; };
} }

View File

@@ -26,3 +26,6 @@ GN_ARRAY_LIST(loaderLayer);
loaderLayer* loaderGetNextLayer(gnInstance instance); loaderLayer* loaderGetNextLayer(gnInstance instance);
void resetLayer(gnInstance instance); void resetLayer(gnInstance instance);
gnSyncExtFunctions loadAPISyncFunctions(gnRenderingAPI api);