fixed a good couple of metal warnings

This commit is contained in:
Gregory Wells
2025-08-03 15:44:09 -04:00
parent 2a6d3a108a
commit a49a0a5a3e
12 changed files with 65 additions and 54 deletions

View File

@@ -4,10 +4,12 @@
#include "window_surface/gryphn_surface.h"
gnPhysicalDevice* getMetalDevices(gnInstanceHandle instance, uint32_t* deviceCount) {
if (instance == GN_NULL_HANDLE) return NULL;
NSArray *devices = MTLCopyAllDevices();
*deviceCount = (uint32_t)[devices count];
gnPhysicalDevice* devicesList = (gnPhysicalDevice*)malloc(sizeof(gnPhysicalDevice) * *deviceCount);
for (int i = 0; i < *deviceCount; i++) {
for (uint32_t i = 0; i < *deviceCount; i++) {
devicesList[i] = malloc(sizeof(gnPhysicalOutputDevice_t));
devicesList[i]->physicalDevice = malloc(sizeof(gnPlatformPhysicalDevice));
devicesList[i]->physicalDevice->device = [devices objectAtIndex:0];
@@ -39,5 +41,7 @@ gnPhysicalDevice* getMetalDevices(gnInstanceHandle instance, uint32_t* deviceCou
}
gnBool metalCanDevicePresent(gnPhysicalDevice device, gnWindowSurface windowSurface) {
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
}