From fb145342ce8f4b62aa475539a539352ff022b906 Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Sun, 28 Jul 2024 12:42:54 -0300 Subject: [PATCH] log improvement ThrowInvalidType (#330) * log improvement ThrowInvalidType * log improvement ThrowInvalidType --- src/shader_recompiler/ir/ir_emitter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/shader_recompiler/ir/ir_emitter.cpp b/src/shader_recompiler/ir/ir_emitter.cpp index 6ea3123d..8b605df8 100644 --- a/src/shader_recompiler/ir/ir_emitter.cpp +++ b/src/shader_recompiler/ir/ir_emitter.cpp @@ -2,14 +2,19 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include "shader_recompiler/exception.h" #include "shader_recompiler/ir/ir_emitter.h" #include "shader_recompiler/ir/value.h" namespace Shader::IR { namespace { -[[noreturn]] void ThrowInvalidType(Type type) { - UNREACHABLE_MSG("Invalid type {}", u32(type)); +[[noreturn]] void ThrowInvalidType(Type type, + std::source_location loc = std::source_location::current()) { + const std::string functionName = loc.function_name(); + const int lineNumber = loc.line(); + UNREACHABLE_MSG("Invalid type = {}, functionName = {}, line = {}", u32(type), functionName, + lineNumber); } Value MakeLodClampPair(IREmitter& ir, const F32& bias_lod, const F32& lod_clamp) {