@@ -17,9 +17,6 @@ int main()
1717 NSLog (@" Removable: %@ " , device.isRemovable ? @" YES" : @" NO" );
1818 NSLog (@" Registry ID: %llu " , device.registryID);
1919 NSLog (@" Max Threads Per Threadgroup: %lu " , (unsigned long )device.maxThreadsPerThreadgroup.width);
20- NSLog (@" Max Buffer Length: %llu " , device.maxBufferLength);
21- NSLog (@" Max Texture 2D Size: %lu " , (unsigned long )device.maxTextureSize2D);
22- NSLog (@" Max Texture 3D Size: %lu " , (unsigned long )device.maxTextureSize3D);
2320 NSLog (@" Supports Family Apple7: %@ " , [device supportsFamily: MTLGPUFamilyApple7] ? @" YES" : @" NO" );
2421 NSLog (@" Supports Family Apple8: %@ " , [device supportsFamily: MTLGPUFamilyApple8] ? @" YES" : @" NO" );
2522 NSLog (@" Supports Family Apple9: %@ " , [device supportsFamily: MTLGPUFamilyApple9] ? @" YES" : @" NO" );
@@ -29,22 +26,37 @@ int main()
2926 NSLog (@" Argument Buffers Tier: %lu " , (unsigned long )device.argumentBuffersSupport);
3027 NSLog (@" Read-Write Texture Tier: %lu " , (unsigned long )device.readWriteTextureSupport);
3128
32- // Log texture format capabilities
29+ // Create a simple test texture descriptor to check format support
30+ auto checkTextureFormat = [device](MTLPixelFormat format, const char * name) {
31+ MTLTextureDescriptor * desc = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat: format
32+ width: 64
33+ height: 64
34+ mipmapped: NO ];
35+ @try {
36+ id <MTLTexture > testTexture = [device newTextureWithDescriptor: desc];
37+ NSLog (@" %s : %@ " , name, testTexture != nil ? @" YES" : @" NO" );
38+ }
39+ @catch (NSException *exception) {
40+ NSLog (@" %s : NO" , name);
41+ }
42+ };
43+
3344 NSLog (@" Texture Format Support:" );
34- NSLog (@" Depth24Unorm_Stencil8: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatDepth24Unorm_Stencil8 ] ? @" YES" : @" NO" );
35- NSLog (@" Depth32Float: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatDepth32Float ] ? @" YES" : @" NO" );
36- NSLog (@" Depth32Float_Stencil8: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatDepth32Float_Stencil8 ] ? @" YES" : @" NO" );
37- NSLog (@" BC1_RGBA: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatBC1_RGBA ] ? @" YES" : @" NO" );
38- NSLog (@" BC2_RGBA: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatBC2_RGBA ] ? @" YES" : @" NO" );
39- NSLog (@" BC3_RGBA: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatBC3_RGBA ] ? @" YES" : @" NO" );
40- NSLog (@" BC7_RGBAUnorm: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatBC7_RGBAUnorm ] ? @" YES" : @" NO" );
41- NSLog (@" PVRTC_RGBA_2BPP: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatPVRTC_RGBA_2BPP] ? @" YES" : @" NO" );
42- NSLog (@" PVRTC_RGBA_4BPP: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatPVRTC_RGBA_4BPP] ? @" YES" : @" NO" );
43- NSLog (@" ETC2_RGB8: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatETC2_RGB8] ? @" YES" : @" NO" );
44- NSLog (@" ASTC_4x4_LDR: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatASTC_4x4_LDR] ? @" YES" : @" NO" );
45- NSLog (@" ASTC_4x4_HDR: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatASTC_4x4_HDR] ? @" YES" : @" NO" );
46- NSLog (@" RGBA16Float: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatRGBA16Float ] ? @" YES" : @" NO" );
47- NSLog (@" RGBA32Float: %@ " , [device supportsTextureSampleCount: 1 pixelFormat: MTLPixelFormatRGBA32Float ] ? @" YES" : @" NO" );
45+ checkTextureFormat (MTLPixelFormatRGBA8Unorm , " RGBA8Unorm" );
46+ checkTextureFormat (MTLPixelFormatRGBA8Unorm_sRGB , " RGBA8Unorm_sRGB" );
47+ checkTextureFormat (MTLPixelFormatBGRA8Unorm , " BGRA8Unorm" );
48+ checkTextureFormat (MTLPixelFormatBGRA8Unorm_sRGB , " BGRA8Unorm_sRGB" );
49+ checkTextureFormat (MTLPixelFormatRGBA16Float , " RGBA16Float" );
50+ checkTextureFormat (MTLPixelFormatRGBA32Float , " RGBA32Float" );
51+ checkTextureFormat (MTLPixelFormatDepth32Float , " Depth32Float" );
52+ checkTextureFormat (MTLPixelFormatDepth32Float_Stencil8 , " Depth32Float_Stencil8" );
53+ checkTextureFormat (MTLPixelFormatBC1_RGBA , " BC1_RGBA" );
54+ checkTextureFormat (MTLPixelFormatBC2_RGBA , " BC2_RGBA" );
55+ checkTextureFormat (MTLPixelFormatBC3_RGBA , " BC3_RGBA" );
56+ checkTextureFormat (MTLPixelFormatBC7_RGBAUnorm , " BC7_RGBAUnorm" );
57+ checkTextureFormat (MTLPixelFormatETC2_RGB8, " ETC2_RGB8" );
58+ checkTextureFormat (MTLPixelFormatASTC_4x4_LDR, " ASTC_4x4_LDR" );
59+ checkTextureFormat (MTLPixelFormatASTC_4x4_HDR, " ASTC_4x4_HDR" );
4860
4961 Babylon::Graphics::Configuration config{};
5062 config.Device = device;
0 commit comments