GS:MTL: Move texture size calculation to dedicated function

This commit is contained in:
TellowKrinkle authored and lightningterror committed 2026-04-15 21:52:24 +02:00
1 parent a2e354c629
commit 601b0e60ea
3 files changed
+16 -14

No files matched your search

+1 -8
View File
@@ -35,14 +35,7 @@ std::vector<GSAdapterInfo> GetMetalAdapterList()
{
GSAdapterInfo ai;
ai.name = [[dev name] UTF8String];
ai.max_texture_size = 8192;
if ([dev supportsFeatureSet:MTLFeatureSet_macOS_GPUFamily1_v1])
ai.max_texture_size = 16384;
if (@available(macOS 10.15, iOS 13.0, *))
if ([dev supportsFamily:MTLGPUFamilyApple3])
ai.max_texture_size = 16384;
ai.max_texture_size = GSMTLDevice::GetMaxTextureSize(dev);
ai.max_upscale_multiplier = GSGetMaxUpscaleMultiplier(ai.max_texture_size);
list.push_back(std::move(ai));
}
@@ -42,6 +42,8 @@ struct GSMTLDevice
GSMTLDevice() = default;
explicit GSMTLDevice(MRCOwned<id<MTLDevice>> dev);
static u32 GetMaxTextureSize(id<MTLDevice> dev);
bool IsOk() const { return dev && shaders; }
void Reset()
{
+13 -6
View File
@@ -191,16 +191,23 @@ GSMTLDevice::GSMTLDevice(MRCOwned<id<MTLDevice>> dev)
else
features.slow_color_compression = [[dev name] containsString:@"AMD"] || [[dev name] isEqualToString:@"Intel HD Graphics 4000"];
features.max_texsize = 8192;
if ([dev supportsFeatureSet:MTLFeatureSet_macOS_GPUFamily1_v1])
features.max_texsize = 16384;
if (@available(macOS 10.15, iOS 13.0, *))
if ([dev supportsFamily:MTLGPUFamilyApple3])
features.max_texsize = 16384;
features.max_texsize = GetMaxTextureSize(dev);
this->dev = std::move(dev);
}
u32 GSMTLDevice::GetMaxTextureSize(id<MTLDevice> dev)
{
if (@available(macOS 10.15, iOS 13.0, *))
{
if ([dev supportsFamily:MTLGPUFamilyApple3])
return 16384;
}
if ([dev supportsFeatureSet:MTLFeatureSet_macOS_GPUFamily1_v1])
return 16384;
return 8192;
}
const char* to_string(GSMTLDevice::MetalVersion ver)
{
switch (ver)