check functions for new API
This commit is contained in:
@@ -27,7 +27,7 @@ void checkDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayer
|
||||
gnBool checkIsInstanceSuitable(gnInstanceHandle instance, gnSuitableField field, gryphnInstanceFunctionLayers* next) {
|
||||
if (next == NULL || next->isSuitable == NULL) {
|
||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||
.message = gnCreateString("Failed to load gnCreateInstance this indicates a bug within gryphn")
|
||||
.message = gnCreateString("Failed to load gnIsInstanceSuitable this indicates a bug within gryphn")
|
||||
});
|
||||
return GN_FAILED_TO_LOAD_FUNCTION;
|
||||
}
|
||||
@@ -37,12 +37,46 @@ gnBool checkIsInstanceSuitable(gnInstanceHandle instance, gnSuitableField field,
|
||||
gnReturnCode checkQueryDevices(gnInstanceHandle instance, uint32_t* count, gnPhysicalDeviceHandle* devices, gryphnInstanceFunctionLayers* next) {
|
||||
if (next == NULL || next->queryDevices == NULL) {
|
||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||
.message = gnCreateString("Failed to load gnCreateInstance this indicates a bug within gryphn")
|
||||
.message = gnCreateString("Failed to load gnQueryDevices this indicates a bug within gryphn")
|
||||
});
|
||||
return GN_FAILED_TO_LOAD_FUNCTION;
|
||||
}
|
||||
return next->queryDevices(instance, count, devices, next->next);
|
||||
}
|
||||
|
||||
gnPhysicalDeviceProperties checkQueryPhysicalDeviceProperties(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* next) {
|
||||
if (next == NULL || next->getPhysicalDeviceProperties == NULL) {
|
||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||
.message = gnCreateString("Failed to load gnQueryPhysicalDeviceProperties this indicates a bug within gryphn")
|
||||
});
|
||||
return (gnPhysicalDeviceProperties){
|
||||
.deviceID = -1,
|
||||
.deviceName = gnCreateString("Invalid device"),
|
||||
.deviceType = GN_PHYSICAL_DEVICE_TYPE_FAKED_GPU,
|
||||
.driverVersion = -1
|
||||
};
|
||||
}
|
||||
return next->getPhysicalDeviceProperties(instance, device, next->next);
|
||||
}
|
||||
gnPhysicalDeviceFeatures checkQueryPhysicalDeviceFeatures(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* next) {
|
||||
if (next == NULL || next->getPhysicalDeviceFeatures == NULL) {
|
||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||
.message = gnCreateString("Failed to load gnQueryPhysicalDeviceFeatures this indicates a bug within gryphn")
|
||||
});
|
||||
return (gnPhysicalDeviceFeatures){};
|
||||
}
|
||||
return next->getPhysicalDeviceFeatures(instance, device, next->next);
|
||||
}
|
||||
gnPhysicalDeviceLimits checkQueryPhysicalDeviceLimits(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* next) {
|
||||
if (next == NULL || next->getPhysicalDeviceLimits == NULL) {
|
||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||
.message = gnCreateString("Failed to load gnQueryPhysicalDeviceLimits this indicates a bug within gryphn")
|
||||
});
|
||||
return (gnPhysicalDeviceLimits){};
|
||||
}
|
||||
return next->getPhysicalDeviceLimits(instance, device, next->next);
|
||||
}
|
||||
|
||||
gnBool checkCanDevicePresent(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface) {
|
||||
CHECK_RETURNED_FUNCTION(device->instance, _gnPhysicalDeviceCanPresentToSurface, instanceFunctions, GN_FALSE, device, windowSurface);
|
||||
}
|
||||
|
Reference in New Issue
Block a user