Misc: Replace log printf calls with fmt

This commit is contained in:
Stenzek
2024-05-23 20:20:16 +10:00
parent 49b2e76dea
commit b6d019db66
117 changed files with 1585 additions and 1615 deletions

View File

@ -190,40 +190,39 @@ bool GPUTexture::ValidateConfig(u32 width, u32 height, u32 layers, u32 levels, u
{
if (width > MAX_WIDTH || height > MAX_HEIGHT || layers > MAX_LAYERS || levels > MAX_LEVELS || samples > MAX_SAMPLES)
{
Log_ErrorPrintf("Invalid dimensions: %ux%ux%u %u %u.", width, height, layers, levels, samples);
Log_ErrorFmt("Invalid dimensions: {}x{}x{} {} {}.", width, height, layers, levels, samples);
return false;
}
const u32 max_texture_size = g_gpu_device->GetMaxTextureSize();
if (width > max_texture_size || height > max_texture_size)
{
Log_ErrorPrintf("Texture width (%u) or height (%u) exceeds max texture size (%u).", width, height,
max_texture_size);
Log_ErrorFmt("Texture width ({}) or height ({}) exceeds max texture size ({}).", width, height, max_texture_size);
return false;
}
const u32 max_samples = g_gpu_device->GetMaxMultisamples();
if (samples > max_samples)
{
Log_ErrorPrintf("Texture samples (%u) exceeds max samples (%u).", samples, max_samples);
Log_ErrorFmt("Texture samples ({}) exceeds max samples ({}).", samples, max_samples);
return false;
}
if (samples > 1 && levels > 1)
{
Log_ErrorPrintf("Multisampled textures can't have mip levels.");
Log_ErrorPrint("Multisampled textures can't have mip levels.");
return false;
}
if (layers > 1 && type != Type::Texture && type != Type::DynamicTexture)
{
Log_ErrorPrintf("Texture arrays are not supported on targets.");
Log_ErrorPrint("Texture arrays are not supported on targets.");
return false;
}
if (levels > 1 && type != Type::Texture && type != Type::DynamicTexture)
{
Log_ErrorPrintf("Mipmaps are not supported on targets.");
Log_ErrorPrint("Mipmaps are not supported on targets.");
return false;
}
@ -318,7 +317,7 @@ bool GPUTexture::ConvertTextureDataToRGBA8(u32 width, u32 height, std::vector<u3
}
default:
Log_ErrorPrintf("Unknown pixel format %u", static_cast<u32>(format));
[[unlikely]] Log_ErrorFmt("Unknown pixel format {}", static_cast<u32>(format));
return false;
}
}