log improvement ThrowInvalidType (#330)

* log improvement ThrowInvalidType

* log improvement ThrowInvalidType
This commit is contained in:
DanielSvoboda 2024-07-28 12:42:54 -03:00 committed by GitHub
parent 30198d5ffc
commit fb145342ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -2,14 +2,19 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <bit> #include <bit>
#include <source_location>
#include "shader_recompiler/exception.h" #include "shader_recompiler/exception.h"
#include "shader_recompiler/ir/ir_emitter.h" #include "shader_recompiler/ir/ir_emitter.h"
#include "shader_recompiler/ir/value.h" #include "shader_recompiler/ir/value.h"
namespace Shader::IR { namespace Shader::IR {
namespace { namespace {
[[noreturn]] void ThrowInvalidType(Type type) { [[noreturn]] void ThrowInvalidType(Type type,
UNREACHABLE_MSG("Invalid type {}", u32(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) { Value MakeLodClampPair(IREmitter& ir, const F32& bias_lod, const F32& lod_clamp) {