"fixed" metal impl

This commit is contained in:
Gregory Wells
2025-10-01 09:21:21 -04:00
parent f93853608c
commit 3a5ddac2c5
3 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo
return GN_SUCCESS;
}
gnReturnCode metalQueryDevices(gnInstanceHandle instance, uint32_t* count, gnPhysicalDeviceHandle* devices, gryphnInstanceFunctionLayers* next) {
if (instance == GN_NULL_HANDLE) return NULL;
if (instance == GN_NULL_HANDLE) return GN_INVALID_HANDLE;
NSArray *metalDevices = MTLCopyAllDevices();
*count = (uint32_t)[metalDevices count];
if (devices == NULL) return GN_SUCCESS;

View File

@@ -13,4 +13,4 @@ void metalTextureData(gnTextureHandle texture, void* pixelData);
void metalDestroyTexture(gnTexture texture);
NSUInteger mtlSampleCount(gnMultisampleCountFlags flags);
NSUInteger mtlSampleCount(gnSampleCountFlags flags);

View File

@@ -2,7 +2,7 @@
#include "surface/metal_surface.h"
#include "devices/metal_output_devices.h"
NSUInteger mtlSampleCount(gnMultisampleCountFlags flags) {
NSUInteger mtlSampleCount(gnSampleCountFlags flags) {
if ((flags & GN_SAMPLE_BIT_64) == GN_SAMPLE_BIT_64) { return 64; }
if ((flags & GN_SAMPLE_BIT_32) == GN_SAMPLE_BIT_32) { return 32; }
if ((flags & GN_SAMPLE_BIT_16) == GN_SAMPLE_BIT_16) { return 16; }