citra-emu
/
citra-canary
Archived
1
0
Fork 0

video-core: Migrate logging macros (#3878)

* video-core: Migrate logging macros

* video-core: Fixed missed clang format

* video-core: Migrated LOG_GENERIC macro
This commit is contained in:
NarcolepticK 2018-06-28 17:13:30 -04:00 committed by Weiyi Wang
parent 3cf5c1a5b4
commit 9ae70e733f
22 changed files with 156 additions and 149 deletions

View File

@ -68,7 +68,7 @@ static void WriteUniformIntReg(Shader::ShaderSetup& setup, unsigned index,
const Math::Vec4<u8>& values) {
ASSERT(index < setup.uniforms.i.size());
setup.uniforms.i[index] = values;
LOG_TRACE(HW_GPU, "Set %s integer uniform %d to %02x %02x %02x %02x",
NGLOG_TRACE(HW_GPU, "Set {} integer uniform {} to {:02x} {:02x} {:02x} {:02x}",
GetShaderSetupTypeName(setup), index, values.x, values.y, values.z, values.w);
}
@ -90,7 +90,7 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup,
auto& uniform = setup.uniforms.f[uniform_setup.index];
if (uniform_setup.index >= 96) {
LOG_ERROR(HW_GPU, "Invalid %s float uniform index %d", GetShaderSetupTypeName(setup),
NGLOG_ERROR(HW_GPU, "Invalid {} float uniform index {}", GetShaderSetupTypeName(setup),
(int)uniform_setup.index);
} else {
@ -108,7 +108,7 @@ static void WriteUniformFloatReg(ShaderRegs& config, Shader::ShaderSetup& setup,
uniform.x = float24::FromRaw(uniform_write_buffer[2] & 0xFFFFFF);
}
LOG_TRACE(HW_GPU, "Set %s float uniform %x to (%f %f %f %f)",
NGLOG_TRACE(HW_GPU, "Set {} float uniform {:x} to ({} {} {} {})",
GetShaderSetupTypeName(setup), (int)uniform_setup.index,
uniform.x.ToFloat32(), uniform.y.ToFloat32(), uniform.z.ToFloat32(),
uniform.w.ToFloat32());
@ -123,8 +123,9 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
auto& regs = g_state.regs;
if (id >= Regs::NUM_REGS) {
LOG_ERROR(HW_GPU,
"Commandlist tried to write to invalid register 0x%03X (value: %08X, mask: %X)",
NGLOG_ERROR(
HW_GPU,
"Commandlist tried to write to invalid register 0x{:03X} (value: {:08X}, mask: {:X})",
id, value, mask);
return;
}
@ -183,7 +184,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
auto& setup = regs.pipeline.vs_default_attributes_setup;
if (setup.index >= 16) {
LOG_ERROR(HW_GPU, "Invalid VS default attribute index %d", (int)setup.index);
NGLOG_ERROR(HW_GPU, "Invalid VS default attribute index {}", (int)setup.index);
break;
}
@ -197,7 +198,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
((default_attr_write_buffer[2] >> 24) & 0xFF));
attribute.x = float24::FromRaw(default_attr_write_buffer[2] & 0xFFFFFF);
LOG_TRACE(HW_GPU, "Set default VS attribute %x to (%f %f %f %f)", (int)setup.index,
NGLOG_TRACE(HW_GPU, "Set default VS attribute {:x} to ({} {} {} {})", (int)setup.index,
attribute.x.ToFloat32(), attribute.y.ToFloat32(), attribute.z.ToFloat32(),
attribute.w.ToFloat32());
@ -473,7 +474,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
case PICA_REG_INDEX_WORKAROUND(gs.program.set_word[7], 0x2a3): {
u32& offset = g_state.regs.gs.program.offset;
if (offset >= 4096) {
LOG_ERROR(HW_GPU, "Invalid GS program offset %u", offset);
NGLOG_ERROR(HW_GPU, "Invalid GS program offset {}", offset);
} else {
g_state.gs.program_code[offset] = value;
g_state.gs.MarkProgramCodeDirty();
@ -492,7 +493,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
case PICA_REG_INDEX_WORKAROUND(gs.swizzle_patterns.set_word[7], 0x2ad): {
u32& offset = g_state.regs.gs.swizzle_patterns.offset;
if (offset >= g_state.gs.swizzle_data.size()) {
LOG_ERROR(HW_GPU, "Invalid GS swizzle pattern offset %u", offset);
NGLOG_ERROR(HW_GPU, "Invalid GS swizzle pattern offset {}", offset);
} else {
g_state.gs.swizzle_data[offset] = value;
g_state.gs.MarkSwizzleDataDirty();
@ -542,7 +543,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
case PICA_REG_INDEX_WORKAROUND(vs.program.set_word[7], 0x2d3): {
u32& offset = g_state.regs.vs.program.offset;
if (offset >= 512) {
LOG_ERROR(HW_GPU, "Invalid VS program offset %u", offset);
NGLOG_ERROR(HW_GPU, "Invalid VS program offset {}", offset);
} else {
g_state.vs.program_code[offset] = value;
g_state.vs.MarkProgramCodeDirty();
@ -565,7 +566,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
case PICA_REG_INDEX_WORKAROUND(vs.swizzle_patterns.set_word[7], 0x2dd): {
u32& offset = g_state.regs.vs.swizzle_patterns.offset;
if (offset >= g_state.vs.swizzle_data.size()) {
LOG_ERROR(HW_GPU, "Invalid VS swizzle pattern offset %u", offset);
NGLOG_ERROR(HW_GPU, "Invalid VS swizzle pattern offset {}", offset);
} else {
g_state.vs.swizzle_data[offset] = value;
g_state.vs.MarkSwizzleDataDirty();

View File

@ -178,7 +178,8 @@ void DumpShader(const std::string& filename, const ShaderRegs& config,
}
} catch (const std::out_of_range&) {
DEBUG_ASSERT_MSG(false, "Unknown output attribute mapping");
LOG_ERROR(HW_GPU, "Unknown output attribute mapping: %03x, %03x, %03x, %03x",
NGLOG_ERROR(HW_GPU,
"Unknown output attribute mapping: {:03x}, {:03x}, {:03x}, {:03x}",
(int)output_attributes[i].map_x.Value(),
(int)output_attributes[i].map_y.Value(),
(int)output_attributes[i].map_z.Value(),
@ -277,7 +278,7 @@ bool g_is_pica_tracing = false;
void StartPicaTracing() {
if (g_is_pica_tracing) {
LOG_WARNING(HW_GPU, "StartPicaTracing called even though tracing already running!");
NGLOG_WARNING(HW_GPU, "StartPicaTracing called even though tracing already running!");
return;
}
@ -298,7 +299,7 @@ void OnPicaRegWrite(PicaTrace::Write write) {
std::unique_ptr<PicaTrace> FinishPicaTracing() {
if (!g_is_pica_tracing) {
LOG_WARNING(HW_GPU, "FinishPicaTracing called even though tracing isn't running!");
NGLOG_WARNING(HW_GPU, "FinishPicaTracing called even though tracing isn't running!");
return {};
}
@ -456,7 +457,7 @@ void DumpTevStageConfig(const std::array<TexturingRegs::TevStageConfig, 6>& stag
GetTevStageConfigColorCombinerString(tev_stage) + " " +
GetTevStageConfigAlphaCombinerString(tev_stage) + "\n";
}
LOG_TRACE(HW_GPU, "%s", stage_info.c_str());
NGLOG_TRACE(HW_GPU, "{}", stage_info);
}
} // namespace DebugUtils

View File

@ -30,7 +30,7 @@ public:
virtual void GXCommandProcessed(int total_command_count) {
const Service::GSP::Command& cmd =
observed->ReadGXCommandHistory(total_command_count - 1);
LOG_TRACE(Debug_GPU, "Received command: id=%x", (int)cmd.id.Value());
NGLOG_TRACE(Debug_GPU, "Received command: id={:x}", (int)cmd.id.Value());
}
protected:

View File

@ -48,7 +48,7 @@ void PrimitiveAssembler<VertexType>::SubmitVertex(const VertexType& vtx,
break;
default:
LOG_ERROR(HW_GPU, "Unknown triangle topology %x:", (int)topology);
NGLOG_ERROR(HW_GPU, "Unknown triangle topology {:x}:", (int)topology);
break;
}
}

View File

@ -200,7 +200,7 @@ struct FramebufferRegs {
case ColorFormat::RGBA4:
return 2;
default:
LOG_CRITICAL(HW_GPU, "Unknown color format %u", static_cast<u32>(format));
NGLOG_CRITICAL(HW_GPU, "Unknown color format {}", static_cast<u32>(format));
UNIMPLEMENTED();
}
}

View File

@ -1600,7 +1600,7 @@ void RasterizerOpenGL::SyncCullMode() {
break;
default:
LOG_CRITICAL(Render_OpenGL, "Unknown cull mode %u",
NGLOG_CRITICAL(Render_OpenGL, "Unknown cull mode {}",
static_cast<u32>(regs.rasterizer.cull_mode.Value()));
UNIMPLEMENTED();
break;

View File

@ -1390,7 +1390,7 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces(
// Make sure that framebuffers don't overlap if both color and depth are being used
if (using_color_fb && using_depth_fb &&
boost::icl::length(color_vp_interval & depth_vp_interval)) {
LOG_CRITICAL(Render_OpenGL, "Color and depth framebuffer memory regions overlap; "
NGLOG_CRITICAL(Render_OpenGL, "Color and depth framebuffer memory regions overlap; "
"overlapping framebuffers not supported!");
using_depth_fb = false;
}

View File

@ -546,9 +546,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));
NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(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));
NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op_y));
} else if (op_x != op_y) {
shader.AddLine("conditional_code.x = " + src1 + ".x " +
cmp_ops.find(op_x)->second.first + " " + src2 + ".x;");
@ -572,7 +572,7 @@ private:
}
default: {
LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x%02x (%s): 0x%08x",
NGLOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}",
(int)instr.opcode.Value().EffectiveOpCode(),
instr.opcode.Value().GetInfo().name, instr.hex);
throw DecompileFail("Unhandled instruction");
@ -616,7 +616,7 @@ private:
SetDest(swizzle, dest_reg, src1 + " * " + src2 + " + " + src3, 4, 4);
}
} else {
LOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x%02x (%s): 0x%08x",
NGLOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}",
(int)instr.opcode.Value().EffectiveOpCode(),
instr.opcode.Value().GetInfo().name, instr.hex);
throw DecompileFail("Unhandled instruction");
@ -770,7 +770,7 @@ private:
}
default: {
LOG_ERROR(HW_GPU, "Unhandled instruction: 0x%02x (%s): 0x%08x",
NGLOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}",
(int)instr.opcode.Value().EffectiveOpCode(),
instr.opcode.Value().GetInfo().name, instr.hex);
throw DecompileFail("Unhandled instruction");
@ -921,7 +921,7 @@ boost::optional<std::string> DecompileProgram(const ProgramCode& program_code,
inputreg_getter, outputreg_getter, sanitize_mul, is_gs);
return generator.MoveShaderCode();
} catch (const DecompileFail& exception) {
LOG_INFO(HW_GPU, "Shader decompilation failed: %s", exception.what());
NGLOG_INFO(HW_GPU, "Shader decompilation failed: {}", exception.what());
return boost::none;
}
}

View File

@ -320,7 +320,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un
case TexturingRegs::TextureConfig::ShadowCube:
return "shadowTextureCube(texcoord0, texcoord0_w)";
default:
LOG_CRITICAL(HW_GPU, "Unhandled texture type %x",
NGLOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}",
static_cast<int>(state.texture0_type));
UNIMPLEMENTED();
return "texture(tex0, texcoord0)";
@ -383,7 +383,7 @@ static void AppendSource(std::string& out, const PicaFSConfig& config,
break;
default:
out += "vec4(0.0)";
LOG_CRITICAL(Render_OpenGL, "Unknown source op %u", static_cast<u32>(source));
NGLOG_CRITICAL(Render_OpenGL, "Unknown source op {}", static_cast<u32>(source));
break;
}
}
@ -441,7 +441,7 @@ static void AppendColorModifier(std::string& out, const PicaFSConfig& config,
break;
default:
out += "vec3(0.0)";
LOG_CRITICAL(Render_OpenGL, "Unknown color modifier op %u", static_cast<u32>(modifier));
NGLOG_CRITICAL(Render_OpenGL, "Unknown color modifier op {}", static_cast<u32>(modifier));
break;
}
}
@ -490,7 +490,7 @@ static void AppendAlphaModifier(std::string& out, const PicaFSConfig& config,
break;
default:
out += "0.0";
LOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op %u", static_cast<u32>(modifier));
NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op {}", static_cast<u32>(modifier));
break;
}
}
@ -534,7 +534,7 @@ static void AppendColorCombiner(std::string& out, TevStageConfig::Operation oper
break;
default:
out += "vec3(0.0)";
LOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: %u",
NGLOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}",
static_cast<u32>(operation));
break;
}
@ -575,7 +575,7 @@ static void AppendAlphaCombiner(std::string& out, TevStageConfig::Operation oper
break;
default:
out += "0.0";
LOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: %u",
NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}",
static_cast<u32>(operation));
break;
}
@ -606,7 +606,7 @@ static void AppendAlphaTestCondition(std::string& out, FramebufferRegs::CompareF
default:
out += "false";
LOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition %u", static_cast<u32>(func));
NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition {}", static_cast<u32>(func));
break;
}
}
@ -776,7 +776,7 @@ static void WriteLighting(std::string& out, const PicaFSConfig& config) {
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown lighting LUT input %d\n", (int)input);
NGLOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", (int)input);
UNIMPLEMENTED();
index = "0.0";
break;
@ -992,7 +992,7 @@ void AppendProcTexShiftOffset(std::string& out, const std::string& v, ProcTexShi
out += offset + " * (((int(" + v + ") + 1) / 2) % 2)";
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown shift mode %u", static_cast<u32>(mode));
NGLOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast<u32>(mode));
out += "0";
break;
}
@ -1018,7 +1018,7 @@ void AppendProcTexClamp(std::string& out, const std::string& var, ProcTexClamp m
out += var + " = " + var + " > 0.5 ? 1.0 : 0.0;\n";
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown clamp mode %u", static_cast<u32>(mode));
NGLOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast<u32>(mode));
out += var + " = " + "min(" + var + ", 1.0);\n";
break;
}
@ -1059,7 +1059,7 @@ void AppendProcTexCombineAndMap(std::string& out, ProcTexCombiner combiner,
combined = "min(((u + v) * 0.5 + sqrt(u * u + v * v)) * 0.5, 1.0)";
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown combiner %u", static_cast<u32>(combiner));
NGLOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast<u32>(combiner));
combined = "0.0";
break;
}
@ -1499,7 +1499,7 @@ vec4 secondary_fragment_color = vec4(0.0);
} else if (state.fog_mode == TexturingRegs::FogMode::Gas) {
Core::Telemetry().AddField(Telemetry::FieldType::Session, "VideoCore_Pica_UseGasMode",
true);
LOG_CRITICAL(Render_OpenGL, "Unimplemented gas mode");
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented gas mode");
out += "discard; }";
return out;
}

View File

@ -171,7 +171,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram
? (!right_eye ? framebuffer.address_left1 : framebuffer.address_right1)
: (!right_eye ? framebuffer.address_left2 : framebuffer.address_right2);
LOG_TRACE(Render_OpenGL, "0x%08x bytes from 0x%08x(%dx%d), fmt %x",
NGLOG_TRACE(Render_OpenGL, "0x{:08x} bytes from 0x{:08x}({}x{}), fmt {:x}",
framebuffer.stride * framebuffer.height, framebuffer_addr, (int)framebuffer.width,
(int)framebuffer.height, (int)framebuffer.format);
@ -494,8 +494,8 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum
level = Log::Level::Debug;
break;
}
LOG_GENERIC(Log::Class::Render_OpenGL, level, "%s %s %d: %s", GetSource(source), GetType(type),
id, message);
NGLOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source),
GetType(type), id, message);
}
/// Initialize the renderer
@ -511,9 +511,9 @@ bool RendererOpenGL::Init() {
const char* gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
const char* gpu_model{reinterpret_cast<char const*>(glGetString(GL_RENDERER))};
LOG_INFO(Render_OpenGL, "GL_VERSION: %s", gl_version);
LOG_INFO(Render_OpenGL, "GL_VENDOR: %s", gpu_vendor);
LOG_INFO(Render_OpenGL, "GL_RENDERER: %s", gpu_model);
NGLOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
NGLOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
NGLOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Vendor", gpu_vendor);
Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model);

View File

@ -65,9 +65,9 @@ OutputVertex OutputVertex::FromAttributeBuffer(const RasterizerRegs& regs,
ret.color[i] = float24::FromFloat32(c < 1.0f ? c : 1.0f);
}
LOG_TRACE(HW_GPU,
"Output vertex: pos(%.2f, %.2f, %.2f, %.2f), quat(%.2f, %.2f, %.2f, %.2f), "
"col(%.2f, %.2f, %.2f, %.2f), tc0(%.2f, %.2f), view(%.2f, %.2f, %.2f)",
NGLOG_TRACE(HW_GPU,
"Output vertex: pos({:.2}, {:.2}, {:.2}, {:.2}), quat({:.2}, {:.2}, {:.2}, {:.2}), "
"col({:.2}, {:.2}, {:.2}, {:.2}), tc0({:.2}, {:.2}), view({:.2}, {:.2}, {:.2})",
ret.pos.x.ToFloat32(), ret.pos.y.ToFloat32(), ret.pos.z.ToFloat32(),
ret.pos.w.ToFloat32(), ret.quat.x.ToFloat32(), ret.quat.y.ToFloat32(),
ret.quat.z.ToFloat32(), ret.quat.w.ToFloat32(), ret.color.x.ToFloat32(),

View File

@ -404,7 +404,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData
break;
default:
LOG_ERROR(HW_GPU, "Unknown compare mode %x", static_cast<int>(op));
NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op));
break;
}
}
@ -446,7 +446,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData
}
default:
LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x%02x (%s): 0x%08x",
NGLOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}",
(int)instr.opcode.Value().EffectiveOpCode(),
instr.opcode.Value().GetInfo().name, instr.hex);
DEBUG_ASSERT(false);
@ -535,7 +535,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData
}
Record<DebugDataRecord::DEST_OUT>(debug_data, iteration, dest);
} else {
LOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x%02x (%s): 0x%08x",
NGLOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}",
(int)instr.opcode.Value().EffectiveOpCode(),
instr.opcode.Value().GetInfo().name, instr.hex);
}
@ -653,7 +653,7 @@ static void RunInterpreter(const ShaderSetup& setup, UnitState& state, DebugData
}
default:
LOG_ERROR(HW_GPU, "Unhandled instruction: 0x%02x (%s): 0x%08x",
NGLOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}",
(int)instr.opcode.Value().EffectiveOpCode(),
instr.opcode.Value().GetInfo().name, instr.hex);
break;

View File

@ -161,7 +161,7 @@ static const u8 NO_SRC_REG_SWIZZLE = 0x1b;
static const u8 NO_DEST_REG_MASK = 0xf;
static void LogCritical(const char* msg) {
LOG_CRITICAL(HW_GPU, "%s", msg);
NGLOG_CRITICAL(HW_GPU, "{}", msg);
}
void JitShader::Compile_Assert(bool condition, const char* msg) {
@ -858,7 +858,7 @@ void JitShader::Compile_NextInstr() {
((*this).*instr_func)(instr);
} else {
// Unhandled instruction
LOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x%02x (0x%08x)",
NGLOG_CRITICAL(HW_GPU, "Unhandled instruction: 0x{:02x} (0x{:08x})",
static_cast<u32>(instr.opcode.Value().EffectiveOpCode()), instr.hex);
}
}
@ -945,7 +945,7 @@ void JitShader::Compile(const std::array<u32, MAX_PROGRAM_CODE_LENGTH>* program_
ready();
ASSERT_MSG(getSize() <= MAX_SHADER_SIZE, "Compiled a shader that exceeds the allocated size!");
LOG_DEBUG(HW_GPU, "Compiled shader size=%lu", getSize());
NGLOG_DEBUG(HW_GPU, "Compiled shader size={}", getSize());
}
JitShader::JitShader() : Xbyak::CodeGenerator(MAX_SHADER_SIZE) {

View File

@ -173,19 +173,20 @@ void ProcessTriangle(const OutputVertex& v0, const OutputVertex& v1, const Outpu
InitScreenCoordinates(vtx2);
LOG_TRACE(Render_Software,
"Triangle %lu/%lu at position (%.3f, %.3f, %.3f, %.3f), "
"(%.3f, %.3f, %.3f, %.3f), (%.3f, %.3f, %.3f, %.3f) and "
"screen position (%.2f, %.2f, %.2f), (%.2f, %.2f, %.2f), (%.2f, %.2f, %.2f)",
NGLOG_TRACE(
Render_Software,
"Triangle {}/{} at position ({:.3}, {:.3}, {:.3}, {:.3f}), "
"({:.3}, {:.3}, {:.3}, {:.3}), ({:.3}, {:.3}, {:.3}, {:.3}) and "
"screen position ({:.2}, {:.2}, {:.2}), ({:.2}, {:.2}, {:.2}), ({:.2}, {:.2}, {:.2})",
i + 1, output_list->size() - 2, vtx0.pos.x.ToFloat32(), vtx0.pos.y.ToFloat32(),
vtx0.pos.z.ToFloat32(), vtx0.pos.w.ToFloat32(), vtx1.pos.x.ToFloat32(),
vtx1.pos.y.ToFloat32(), vtx1.pos.z.ToFloat32(), vtx1.pos.w.ToFloat32(),
vtx2.pos.x.ToFloat32(), vtx2.pos.y.ToFloat32(), vtx2.pos.z.ToFloat32(),
vtx2.pos.w.ToFloat32(), vtx0.screenpos.x.ToFloat32(),
vtx0.screenpos.y.ToFloat32(), vtx0.screenpos.z.ToFloat32(),
vtx1.screenpos.x.ToFloat32(), vtx1.screenpos.y.ToFloat32(),
vtx1.screenpos.z.ToFloat32(), vtx2.screenpos.x.ToFloat32(),
vtx2.screenpos.y.ToFloat32(), vtx2.screenpos.z.ToFloat32());
vtx2.pos.w.ToFloat32(), vtx0.screenpos.x.ToFloat32(), vtx0.screenpos.y.ToFloat32(),
vtx0.screenpos.z.ToFloat32(), vtx1.screenpos.x.ToFloat32(),
vtx1.screenpos.y.ToFloat32(), vtx1.screenpos.z.ToFloat32(),
vtx2.screenpos.x.ToFloat32(), vtx2.screenpos.y.ToFloat32(),
vtx2.screenpos.z.ToFloat32());
Rasterizer::ProcessTriangle(vtx0, vtx1, vtx2);
}

View File

@ -57,7 +57,7 @@ void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
break;
default:
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x",
NGLOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}",
static_cast<u32>(framebuffer.color_format.Value()));
UNIMPLEMENTED();
}
@ -93,7 +93,7 @@ const Math::Vec4<u8> GetPixel(int x, int y) {
return Color::DecodeRGBA4(src_pixel);
default:
LOG_CRITICAL(Render_Software, "Unknown framebuffer color format %x",
NGLOG_CRITICAL(Render_Software, "Unknown framebuffer color format {:x}",
static_cast<u32>(framebuffer.color_format.Value()));
UNIMPLEMENTED();
}
@ -123,7 +123,7 @@ u32 GetDepth(int x, int y) {
case FramebufferRegs::DepthFormat::D24S8:
return Color::DecodeD24S8(src_pixel).x;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u",
NGLOG_CRITICAL(HW_GPU, "Unimplemented depth format {}",
static_cast<u32>(framebuffer.depth_format.Value()));
UNIMPLEMENTED();
return 0;
@ -149,9 +149,9 @@ u8 GetStencil(int x, int y) {
return Color::DecodeD24S8(src_pixel).y;
default:
LOG_WARNING(
NGLOG_WARNING(
HW_GPU,
"GetStencil called for function which doesn't have a stencil component (format %u)",
"GetStencil called for function which doesn't have a stencil component (format {})",
static_cast<u32>(framebuffer.depth_format.Value()));
return 0;
}
@ -185,7 +185,7 @@ void SetDepth(int x, int y, u32 value) {
break;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u",
NGLOG_CRITICAL(HW_GPU, "Unimplemented depth format {}",
static_cast<u32>(framebuffer.depth_format.Value()));
UNIMPLEMENTED();
break;
@ -217,7 +217,7 @@ void SetStencil(int x, int y, u8 value) {
break;
default:
LOG_CRITICAL(HW_GPU, "Unimplemented depth format %u",
NGLOG_CRITICAL(HW_GPU, "Unimplemented depth format {}",
static_cast<u32>(framebuffer.depth_format.Value()));
UNIMPLEMENTED();
break;
@ -253,7 +253,7 @@ u8 PerformStencilAction(FramebufferRegs::StencilAction action, u8 old_stencil, u
return old_stencil - 1;
default:
LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", (int)action);
NGLOG_CRITICAL(HW_GPU, "Unknown stencil action {:x}", (int)action);
UNIMPLEMENTED();
return 0;
}
@ -297,7 +297,7 @@ Math::Vec4<u8> EvaluateBlendEquation(const Math::Vec4<u8>& src, const Math::Vec4
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation 0x%x", static_cast<u8>(equation));
NGLOG_CRITICAL(HW_GPU, "Unknown RGB blend equation 0x{:x}", static_cast<u8>(equation));
UNIMPLEMENTED();
}

View File

@ -53,7 +53,7 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
surface_normal = Math::MakeVec(0.0f, 0.0f, 1.0f);
surface_tangent = perturbation;
} else {
LOG_ERROR(HW_GPU, "Unknown bump mode %u",
NGLOG_ERROR(HW_GPU, "Unknown bump mode {}",
static_cast<u32>(lighting.config0.bump_mode.Value()));
}
} else {
@ -143,7 +143,7 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors(
}
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown lighting LUT input %u\n", static_cast<u32>(input));
NGLOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", static_cast<u32>(input));
UNIMPLEMENTED();
result = 0.0f;
}

View File

@ -77,7 +77,7 @@ static float GetShiftOffset(float v, ProcTexShift mode, ProcTexClamp clamp_mode)
case ProcTexShift::Even:
return offset * ((((int)v + 1) / 2) % 2);
default:
LOG_CRITICAL(HW_GPU, "Unknown shift mode %u", static_cast<u32>(mode));
NGLOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast<u32>(mode));
return 0;
}
};
@ -107,7 +107,7 @@ static void ClampCoord(float& coord, ProcTexClamp mode) {
coord = 1.0f;
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown clamp mode %u", static_cast<u32>(mode));
NGLOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast<u32>(mode));
coord = std::min(coord, 1.0f);
break;
}
@ -148,7 +148,7 @@ float CombineAndMap(float u, float v, ProcTexCombiner combiner,
f = std::min(((u + v) * 0.5f + std::sqrt(u * u + v * v)) * 0.5f, 1.0f);
break;
default:
LOG_CRITICAL(HW_GPU, "Unknown combiner %u", static_cast<u32>(combiner));
NGLOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast<u32>(combiner));
f = 0.0f;
break;
}

View File

@ -363,7 +363,8 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
}
default:
// TODO: Change to LOG_ERROR when more types are handled.
LOG_DEBUG(HW_GPU, "Unhandled texture type %x", (int)texture.config.type);
NGLOG_DEBUG(HW_GPU, "Unhandled texture type {:x}",
(int)texture.config.type);
UNIMPLEMENTED();
break;
}
@ -512,7 +513,7 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
return combiner_output;
default:
LOG_ERROR(HW_GPU, "Unknown color combiner source %d", (int)source);
NGLOG_ERROR(HW_GPU, "Unknown color combiner source {}", (int)source);
UNIMPLEMENTED();
return {0, 0, 0, 0};
}
@ -843,7 +844,8 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve
return std::min(combiner_output.a(), static_cast<u8>(255 - dest.a()));
default:
LOG_CRITICAL(HW_GPU, "Unknown blend factor %x", static_cast<u32>(factor));
NGLOG_CRITICAL(HW_GPU, "Unknown blend factor {:x}",
static_cast<u32>(factor));
UNIMPLEMENTED();
break;
}

View File

@ -48,7 +48,7 @@ int GetWrappedTexCoord(TexturingRegs::TextureConfig::WrapMode mode, int val, uns
}
default:
LOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode %x", (int)mode);
NGLOG_ERROR(HW_GPU, "Unknown texture coordinate wrapping mode {:x}", (int)mode);
UNIMPLEMENTED();
return 0;
}
@ -197,7 +197,7 @@ Math::Vec3<u8> ColorCombine(TevStageConfig::Operation op, const Math::Vec3<u8> i
return {(u8)result, (u8)result, (u8)result};
}
default:
LOG_ERROR(HW_GPU, "Unknown color combiner operation %d", (int)op);
NGLOG_ERROR(HW_GPU, "Unknown color combiner operation {}", (int)op);
UNIMPLEMENTED();
return {0, 0, 0};
}
@ -234,7 +234,7 @@ u8 AlphaCombine(TevStageConfig::Operation op, const std::array<u8, 3>& input) {
return (std::min(255, (input[0] + input[1])) * input[2]) / 255;
default:
LOG_ERROR(HW_GPU, "Unknown alpha combiner operation %d", (int)op);
NGLOG_ERROR(HW_GPU, "Unknown alpha combiner operation {}", (int)op);
UNIMPLEMENTED();
return 0;
}

View File

@ -206,7 +206,7 @@ Math::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int
}
default:
LOG_ERROR(HW_GPU, "Unknown texture format: %x", (u32)info.format);
NGLOG_ERROR(HW_GPU, "Unknown texture format: {:x}", (u32)info.format);
DEBUG_ASSERT(false);
return {};
}

View File

@ -37,8 +37,9 @@ void VertexLoader::Setup(const PipelineRegs& regs) {
// TODO: What happens if a loader overwrites a previous one's data?
for (unsigned component = 0; component < loader_config.component_count; ++component) {
if (component >= 12) {
LOG_ERROR(HW_GPU,
"Overflow in the vertex attribute loader %u trying to load component %u",
NGLOG_ERROR(
HW_GPU,
"Overflow in the vertex attribute loader {} trying to load component {}",
loader, component);
continue;
}
@ -136,9 +137,9 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex,
comp == 3 ? float24::FromFloat32(1.0f) : float24::FromFloat32(0.0f);
}
LOG_TRACE(HW_GPU,
"Loaded %d components of attribute %x for vertex %x (index %x) from "
"0x%08x + 0x%08x + 0x%04x: %f %f %f %f",
NGLOG_TRACE(HW_GPU,
"Loaded {} components of attribute {:x} for vertex {:x} (index {:x}) from "
"0x{:08x} + 0x{:08x} + 0x{:04x}: {} {} {} {}",
vertex_attribute_elements[i], i, vertex, index, base_address,
vertex_attribute_sources[i], vertex_attribute_strides[i] * vertex,
input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(),
@ -146,8 +147,9 @@ void VertexLoader::LoadVertex(u32 base_address, int index, int vertex,
} else if (vertex_attribute_is_default[i]) {
// Load the default attribute if we're configured to do so
input.attr[i] = g_state.input_default_attributes.attr[i];
LOG_TRACE(HW_GPU,
"Loaded default attribute %x for vertex %x (index %x): (%f, %f, %f, %f)", i,
NGLOG_TRACE(
HW_GPU,
"Loaded default attribute {:x} for vertex {:x} (index {:x}): ({}, {}, {}, {})", i,
vertex, index, input.attr[i][0].ToFloat32(), input.attr[i][1].ToFloat32(),
input.attr[i][2].ToFloat32(), input.attr[i][3].ToFloat32());
} else {

View File

@ -31,9 +31,9 @@ bool Init(EmuWindow* emu_window) {
g_renderer = std::make_unique<RendererOpenGL>();
g_renderer->SetWindow(g_emu_window);
if (g_renderer->Init()) {
LOG_DEBUG(Render, "initialized OK");
NGLOG_DEBUG(Render, "initialized OK");
} else {
LOG_ERROR(Render, "initialization failed !");
NGLOG_ERROR(Render, "initialization failed !");
return false;
}
return true;
@ -45,7 +45,7 @@ void Shutdown() {
g_renderer.reset();
LOG_DEBUG(Render, "shutdown OK");
NGLOG_DEBUG(Render, "shutdown OK");
}
} // namespace VideoCore