Merge pull request #5657 from FearlessTobi/port-5158
Port yuzu-emu/yuzu#5158: "video_core: Remove unnecessary enum class casting in logging messages"
This commit is contained in:
commit
6b2e7b77cc
12 changed files with 32 additions and 42 deletions
|
@ -747,8 +747,7 @@ void CachedSurface::DumpTexture(GLuint target_tex, u64 tex_hash) {
|
|||
return;
|
||||
}
|
||||
|
||||
dump_path += fmt::format("tex1_{}x{}_{:016X}_{}.png", width, height, tex_hash,
|
||||
static_cast<u32>(pixel_format));
|
||||
dump_path += fmt::format("tex1_{}x{}_{:016X}_{}.png", width, height, tex_hash, pixel_format);
|
||||
if (!custom_tex_cache.IsTextureDumped(tex_hash) && !FileUtil::Exists(dump_path)) {
|
||||
custom_tex_cache.SetTextureDumped(tex_hash);
|
||||
|
||||
|
|
|
@ -561,9 +561,9 @@ private:
|
|||
const CompareOp op_y = instr.common.compare_op.y.Value();
|
||||
|
||||
if (cmp_ops.find(op_x) == cmp_ops.end()) {
|
||||
LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op_x));
|
||||
LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", op_x);
|
||||
} else if (cmp_ops.find(op_y) == cmp_ops.end()) {
|
||||
LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op_y));
|
||||
LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", op_y);
|
||||
} else if (op_x != op_y) {
|
||||
shader.AddLine("conditional_code.x = {}.x {} {}.x;", src1,
|
||||
cmp_ops.find(op_x)->second.first, src2);
|
||||
|
|
|
@ -161,7 +161,7 @@ std::optional<std::vector<ShaderDiskCacheRaw>> ShaderDiskCache::LoadTransferable
|
|||
}
|
||||
default:
|
||||
LOG_ERROR(Render_OpenGL, "Unknown transferable shader cache entry kind={} - skipping",
|
||||
static_cast<u32>(kind));
|
||||
kind);
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,8 +278,7 @@ void PicaGSConfigCommonRaw::Init(const Pica::Regs& regs) {
|
|||
if (static_cast<std::size_t>(semantic) < 24) {
|
||||
semantic_maps[static_cast<std::size_t>(semantic)] = {attrib, comp};
|
||||
} else if (semantic != VSOutputAttributes::INVALID) {
|
||||
LOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}",
|
||||
static_cast<u32>(semantic));
|
||||
LOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}", semantic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -316,8 +315,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un
|
|||
case TexturingRegs::TextureConfig::Disabled:
|
||||
return "vec4(0.0)";
|
||||
default:
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}",
|
||||
static_cast<int>(state.texture0_type));
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}", state.texture0_type);
|
||||
UNIMPLEMENTED();
|
||||
return "texture(tex0, texcoord0)";
|
||||
}
|
||||
|
@ -380,7 +378,7 @@ static void AppendSource(std::string& out, const PicaFSConfig& config,
|
|||
break;
|
||||
default:
|
||||
out += "vec4(0.0)";
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown source op {}", static_cast<u32>(source));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown source op {}", source);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -438,7 +436,7 @@ static void AppendColorModifier(std::string& out, const PicaFSConfig& config,
|
|||
break;
|
||||
default:
|
||||
out += "vec3(0.0)";
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op {}", static_cast<u32>(modifier));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op {}", modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -487,7 +485,7 @@ static void AppendAlphaModifier(std::string& out, const PicaFSConfig& config,
|
|||
break;
|
||||
default:
|
||||
out += "0.0";
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op {}", static_cast<u32>(modifier));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op {}", modifier);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -529,8 +527,7 @@ static void AppendColorCombiner(std::string& out, TevStageConfig::Operation oper
|
|||
break;
|
||||
default:
|
||||
out += "vec3(0.0)";
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}",
|
||||
static_cast<u32>(operation));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}", operation);
|
||||
break;
|
||||
}
|
||||
out += ", vec3(0.0), vec3(1.0))"; // Clamp result to 0.0, 1.0
|
||||
|
@ -568,8 +565,7 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper
|
|||
break;
|
||||
default:
|
||||
out += "0.0";
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}",
|
||||
static_cast<u32>(operation));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}", operation);
|
||||
break;
|
||||
}
|
||||
out += ", 0.0, 1.0)";
|
||||
|
@ -599,7 +595,7 @@ static void AppendAlphaTestCondition(std::string& out, FramebufferRegs::CompareF
|
|||
|
||||
default:
|
||||
out += "false";
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition {}", static_cast<u32>(func));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition {}", func);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -831,8 +827,7 @@ static void WriteLighting(std::string& out, const PicaFSConfig& config) {
|
|||
"{}.position) + {}.dist_atten_bias, 0.0, 1.0)",
|
||||
light_src, light_src, light_src);
|
||||
const auto sampler = LightingRegs::DistanceAttenuationSampler(light_config.num);
|
||||
dist_atten =
|
||||
fmt::format("LookupLightingLUTUnsigned({}, {})", static_cast<u32>(sampler), index);
|
||||
dist_atten = fmt::format("LookupLightingLUTUnsigned({}, {})", sampler, index);
|
||||
}
|
||||
|
||||
if (light_config.geometric_factor_0 || light_config.geometric_factor_1) {
|
||||
|
@ -985,7 +980,7 @@ static void AppendProcTexShiftOffset(std::string& out, std::string_view v, ProcT
|
|||
out += fmt::format("{} * float(((int({}) + 1) / 2) % 2)", offset, v);
|
||||
break;
|
||||
default:
|
||||
LOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast<u32>(mode));
|
||||
LOG_CRITICAL(HW_GPU, "Unknown shift mode {}", mode);
|
||||
out += "0.0";
|
||||
break;
|
||||
}
|
||||
|
@ -1010,7 +1005,7 @@ static void AppendProcTexClamp(std::string& out, std::string_view var, ProcTexCl
|
|||
out += fmt::format("{0} = {0} > 0.5 ? 1.0 : 0.0;\n", var);
|
||||
break;
|
||||
default:
|
||||
LOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast<u32>(mode));
|
||||
LOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", mode);
|
||||
out += fmt::format("{0} = min({0}, 1.0);\n", var);
|
||||
break;
|
||||
}
|
||||
|
@ -1041,7 +1036,7 @@ static void AppendProcTexCombineAndMap(std::string& out, ProcTexCombiner combine
|
|||
case TexturingRegs::ProcTexCombiner::RMax:
|
||||
return "min(((u + v) * 0.5 + sqrt(u * u + v * v)) * 0.5, 1.0)";
|
||||
default:
|
||||
LOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast<u32>(combiner));
|
||||
LOG_CRITICAL(HW_GPU, "Unknown combiner {}", combiner);
|
||||
return "0.0";
|
||||
}
|
||||
}();
|
||||
|
@ -1592,10 +1587,8 @@ ShaderDecompiler::ProgramResult GenerateTrivialVertexShader(bool separable_shade
|
|||
"layout(location = {}) in float vert_texcoord0_w;\n"
|
||||
"layout(location = {}) in vec4 vert_normquat;\n"
|
||||
"layout(location = {}) in vec3 vert_view;\n",
|
||||
static_cast<int>(ATTRIBUTE_POSITION), static_cast<int>(ATTRIBUTE_COLOR),
|
||||
static_cast<int>(ATTRIBUTE_TEXCOORD0), static_cast<int>(ATTRIBUTE_TEXCOORD1),
|
||||
static_cast<int>(ATTRIBUTE_TEXCOORD2), static_cast<int>(ATTRIBUTE_TEXCOORD0_W),
|
||||
static_cast<int>(ATTRIBUTE_NORMQUAT), static_cast<int>(ATTRIBUTE_VIEW));
|
||||
ATTRIBUTE_POSITION, ATTRIBUTE_COLOR, ATTRIBUTE_TEXCOORD0, ATTRIBUTE_TEXCOORD1,
|
||||
ATTRIBUTE_TEXCOORD2, ATTRIBUTE_TEXCOORD0_W, ATTRIBUTE_NORMQUAT, ATTRIBUTE_VIEW);
|
||||
|
||||
out += GetVertexInterfaceDeclaration(true, separable_shader);
|
||||
|
||||
|
|
|
@ -524,7 +524,7 @@ void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading,
|
|||
// Unsupported shader type got stored somehow so nuke the cache
|
||||
|
||||
LOG_CRITICAL(Frontend, "failed to load raw programtype {}",
|
||||
static_cast<u32>(raw.GetProgramType()));
|
||||
raw.GetProgramType());
|
||||
compilation_failed = true;
|
||||
return;
|
||||
}
|
||||
|
@ -585,8 +585,7 @@ void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading,
|
|||
result = std::move(r);
|
||||
} else {
|
||||
// Unsupported shader type got stored somehow so nuke the cache
|
||||
LOG_ERROR(Frontend, "failed to load raw programtype {}",
|
||||
static_cast<u32>(raw.GetProgramType()));
|
||||
LOG_ERROR(Frontend, "failed to load raw programtype {}", raw.GetProgramType());
|
||||
compilation_failed = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ inline GLenum TextureMagFilterMode(TextureFilter mode) {
|
|||
if (mode == TextureFilter::Nearest) {
|
||||
return GL_NEAREST;
|
||||
}
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", static_cast<u32>(mode));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", mode);
|
||||
UNIMPLEMENTED();
|
||||
return GL_LINEAR;
|
||||
}
|
||||
|
@ -59,8 +59,7 @@ inline GLenum TextureMinFilterMode(TextureFilter min, TextureFilter mip) {
|
|||
return GL_NEAREST_MIPMAP_NEAREST;
|
||||
}
|
||||
}
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {} and {}", static_cast<u32>(min),
|
||||
static_cast<u32>(mip));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {} and {}", min, mip);
|
||||
UNIMPLEMENTED();
|
||||
return GL_LINEAR_MIPMAP_LINEAR;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue