fix can device present function
This commit is contained in:
@@ -23,7 +23,7 @@ struct gnPlatformOutputDevice_t {
|
|||||||
} gnPlatformOutputDevice;
|
} gnPlatformOutputDevice;
|
||||||
|
|
||||||
gnPhysicalDevice* getMetalDevices(gnInstanceHandle instance, uint32_t* deviceCount);
|
gnPhysicalDevice* getMetalDevices(gnInstanceHandle instance, uint32_t* deviceCount);
|
||||||
gnBool metalCanDevicePresent(gnPhysicalDevice device, gnWindowSurface windowSurface);
|
gnBool metalCanDevicePresent(gnInstance instance, gnPhysicalDevice device, gnWindowSurface windowSurface);
|
||||||
|
|
||||||
gnReturnCode createMetalOutputDevice(gnInstanceHandle instance, gnOutputDeviceHandle outputDevice, gnOutputDeviceInfo deviceInfo);
|
gnReturnCode createMetalOutputDevice(gnInstanceHandle instance, gnOutputDeviceHandle outputDevice, gnOutputDeviceInfo deviceInfo);
|
||||||
void waitForMetalDevice(gnOutputDeviceHandle device);
|
void waitForMetalDevice(gnOutputDeviceHandle device);
|
||||||
|
@@ -23,7 +23,7 @@ gnPhysicalDeviceProperties metalQueryPhysicalDeviceProperties(gnInstance instanc
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gnBool metalCanDevicePresent(gnPhysicalDevice device, gnWindowSurface windowSurface) {
|
gnBool metalCanDevicePresent(gnInstance instance, gnPhysicalDevice device, gnWindowSurface windowSurface) {
|
||||||
if (device == GN_NULL_HANDLE || windowSurface == GN_NULL_HANDLE) return GN_FALSE;
|
if (device == GN_NULL_HANDLE || windowSurface == GN_NULL_HANDLE) return GN_FALSE;
|
||||||
return GN_TRUE; // I belive that a window should always be able to present to a surface in metal
|
return GN_TRUE; // I belive that a window should always be able to present to a surface in metal
|
||||||
}
|
}
|
||||||
|
@@ -173,7 +173,7 @@ vulkanNeededQueue* vulkanLoadNeededQueues(gnPhysicalDevice physicalDevice, uint3
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gnBool deviceCanPresentToSurface(gnPhysicalDevice physicalDevice, gnWindowSurface surface) {;
|
gnBool deviceCanPresentToSurface(gnInstance instance, gnPhysicalDevice physicalDevice, gnWindowSurface surface) {;
|
||||||
uint32_t queueFamilyCount = 0;
|
uint32_t queueFamilyCount = 0;
|
||||||
vkGetPhysicalDeviceQueueFamilyProperties((VkPhysicalDevice)physicalDevice, &queueFamilyCount, NULL);
|
vkGetPhysicalDeviceQueueFamilyProperties((VkPhysicalDevice)physicalDevice, &queueFamilyCount, NULL);
|
||||||
for (uint32_t i = 0; i < queueFamilyCount; i++) {
|
for (uint32_t i = 0; i < queueFamilyCount; i++) {
|
||||||
|
@@ -14,6 +14,6 @@ gnPhysicalDeviceProperties vulkanQueryPhysicalDeviceProperties(gnInstance instan
|
|||||||
gnPhysicalDeviceFeatures vulkanQueryPhysicalDeviceFeatures(gnInstance instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* layers);
|
gnPhysicalDeviceFeatures vulkanQueryPhysicalDeviceFeatures(gnInstance instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* layers);
|
||||||
gnPhysicalDeviceLimits vulkanQueryPhysicalDeviceLimits(gnInstance instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* layers);
|
gnPhysicalDeviceLimits vulkanQueryPhysicalDeviceLimits(gnInstance instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* layers);
|
||||||
|
|
||||||
gnBool deviceCanPresentToSurface(gnPhysicalDevice device, gnWindowSurface surface);
|
gnBool deviceCanPresentToSurface(gnInstance instance, gnPhysicalDevice device, gnWindowSurface surface);
|
||||||
gnSampleCountFlags vkSampleCountToGryphn(VkSampleCountFlags counts);
|
gnSampleCountFlags vkSampleCountToGryphn(VkSampleCountFlags counts);
|
||||||
VkSampleCountFlags gnSampleCountToVulkan(gnSampleCountFlags counts);
|
VkSampleCountFlags gnSampleCountToVulkan(gnSampleCountFlags counts);
|
||||||
|
@@ -15,5 +15,5 @@ gnPhysicalDeviceLimits gnQueryPhysicalDeviceLimits(gnInstanceHandle instance, gn
|
|||||||
}
|
}
|
||||||
|
|
||||||
gnBool gnPhysicalDeviceCanPresentToSurface(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gnWindowSurfaceHandle windowSurface) {
|
gnBool gnPhysicalDeviceCanPresentToSurface(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gnWindowSurfaceHandle windowSurface) {
|
||||||
return instance->callingLayer->instanceFunctions._gnPhysicalDeviceCanPresentToSurface(device, windowSurface);
|
return instance->callingLayer->instanceFunctions._gnPhysicalDeviceCanPresentToSurface(instance, device, windowSurface);
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ typedef gnPhysicalDeviceFeatures (*PFN_gnQueryPhysicalDeviceFeatures)(gnInstance
|
|||||||
typedef gnPhysicalDeviceLimits (*PFN_gnQueryPhysicalDeviceLimits)(gnInstanceHandle, gnPhysicalDeviceHandle, gryphnInstanceFunctionLayers*);
|
typedef gnPhysicalDeviceLimits (*PFN_gnQueryPhysicalDeviceLimits)(gnInstanceHandle, gnPhysicalDeviceHandle, gryphnInstanceFunctionLayers*);
|
||||||
|
|
||||||
typedef struct gnInstanceFunctions {
|
typedef struct gnInstanceFunctions {
|
||||||
gnBool (*_gnPhysicalDeviceCanPresentToSurface)(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
gnBool (*_gnPhysicalDeviceCanPresentToSurface)(gnInstance instance, gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
||||||
|
|
||||||
gnReturnCode (*_gnCreateOutputDevice)(gnInstanceHandle instance, gnOutputDeviceHandle device, gnOutputDeviceInfo deviceInfo);
|
gnReturnCode (*_gnCreateOutputDevice)(gnInstanceHandle instance, gnOutputDeviceHandle device, gnOutputDeviceInfo deviceInfo);
|
||||||
void (*_gnDestroyOutputDevice)(gnOutputDeviceHandle device);
|
void (*_gnDestroyOutputDevice)(gnOutputDeviceHandle device);
|
||||||
|
@@ -77,9 +77,8 @@ gnPhysicalDeviceLimits checkQueryPhysicalDeviceLimits(gnInstanceHandle instance,
|
|||||||
return next->getPhysicalDeviceLimits(instance, device, next->next);
|
return next->getPhysicalDeviceLimits(instance, device, next->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
gnBool checkCanDevicePresent(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface) {
|
gnBool checkCanDevicePresent(gnInstance instance, gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface) {
|
||||||
// CHECK_RETURNED_FUNCTION(device->instance, _gnPhysicalDeviceCanPresentToSurface, instanceFunctions, GN_FALSE, device, windowSurface);
|
CHECK_RETURNED_FUNCTION(instance, _gnPhysicalDeviceCanPresentToSurface, instanceFunctions, GN_FALSE, instance, device, windowSurface);
|
||||||
return GN_TRUE; // this shit needs to be fixed fast, il work out a spec part for it later
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gnReturnCode checkCreateOutputDevice(gnInstanceHandle instance, gnOutputDeviceHandle device, gnOutputDeviceInfo deviceInfo) {
|
gnReturnCode checkCreateOutputDevice(gnInstanceHandle instance, gnOutputDeviceHandle device, gnOutputDeviceInfo deviceInfo) {
|
||||||
|
@@ -12,7 +12,7 @@ gnPhysicalDeviceFeatures checkQueryPhysicalDeviceFeatures(gnInstanceHandle insta
|
|||||||
gnPhysicalDeviceLimits checkQueryPhysicalDeviceLimits(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* next);
|
gnPhysicalDeviceLimits checkQueryPhysicalDeviceLimits(gnInstanceHandle instance, gnPhysicalDeviceHandle device, gryphnInstanceFunctionLayers* next);
|
||||||
|
|
||||||
// old ahh functions (currently working on removing)
|
// old ahh functions (currently working on removing)
|
||||||
gnBool checkCanDevicePresent(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
gnBool checkCanDevicePresent(gnInstance instance, gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
||||||
gnReturnCode checkCreateOutputDevice(gnInstanceHandle instance, gnOutputDeviceHandle device, gnOutputDeviceInfo deviceInfo);
|
gnReturnCode checkCreateOutputDevice(gnInstanceHandle instance, gnOutputDeviceHandle device, gnOutputDeviceInfo deviceInfo);
|
||||||
void checkDestroyOutputDevice(gnOutputDeviceHandle device);
|
void checkDestroyOutputDevice(gnOutputDeviceHandle device);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user