log: replace all NGLOG with LOG

This commit is contained in:
wwylele 2018-06-29 14:18:07 +03:00
parent fde415968e
commit 7c5a76e58b
152 changed files with 1541 additions and 1541 deletions

View file

@ -43,7 +43,7 @@ RasterizerOpenGL::RasterizerOpenGL()
allow_shadow = GLAD_GL_ARB_shader_image_load_store && GLAD_GL_ARB_shader_image_size &&
GLAD_GL_ARB_framebuffer_no_attachments;
if (!allow_shadow) {
NGLOG_WARNING(
LOG_WARNING(
Render_OpenGL,
"Shadow might not be able to render because of unsupported OpenGL extensions.");
}
@ -432,7 +432,7 @@ bool RasterizerOpenGL::AccelerateDrawBatchInternal(bool is_indexed, bool use_gs)
auto [vs_input_index_min, vs_input_index_max, vs_input_size] = AnalyzeVertexArray(is_indexed);
if (vs_input_size > VERTEX_BUFFER_SIZE) {
NGLOG_WARNING(Render_OpenGL, "Too large vertex input size {}", vs_input_size);
LOG_WARNING(Render_OpenGL, "Too large vertex input size {}", vs_input_size);
return false;
}
@ -453,7 +453,7 @@ bool RasterizerOpenGL::AccelerateDrawBatchInternal(bool is_indexed, bool use_gs)
std::size_t index_buffer_size = regs.pipeline.num_vertices * (index_u16 ? 2 : 1);
if (index_buffer_size > INDEX_BUFFER_SIZE) {
NGLOG_WARNING(Render_OpenGL, "Too large index input size {}", index_buffer_size);
LOG_WARNING(Render_OpenGL, "Too large index input size {}", index_buffer_size);
return false;
}
@ -1600,7 +1600,7 @@ void RasterizerOpenGL::SyncCullMode() {
break;
default:
NGLOG_CRITICAL(Render_OpenGL, "Unknown cull mode {}",
LOG_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)) {
NGLOG_CRITICAL(Render_OpenGL, "Color and depth framebuffer memory regions overlap; "
LOG_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()) {
NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op_x));
LOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op_x));
} else if (cmp_ops.find(op_y) == cmp_ops.end()) {
NGLOG_ERROR(HW_GPU, "Unknown compare mode {:x}", static_cast<int>(op_y));
LOG_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: {
NGLOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x{:02x} ({}): 0x{:08x}",
LOG_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 {
NGLOG_ERROR(HW_GPU, "Unhandled multiply-add instruction: 0x{:02x} ({}): 0x{:08x}",
LOG_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: {
NGLOG_ERROR(HW_GPU, "Unhandled instruction: 0x{:02x} ({}): 0x{:08x}",
LOG_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) {
NGLOG_INFO(HW_GPU, "Shader decompilation failed: {}", exception.what());
LOG_INFO(HW_GPU, "Shader decompilation failed: {}", exception.what());
return boost::none;
}
}

View file

@ -269,7 +269,7 @@ void PicaGSConfigCommonRaw::Init(const Pica::Regs& regs) {
if (static_cast<size_t>(semantic) < 24) {
semantic_maps[static_cast<size_t>(semantic)] = {attrib, comp};
} else if (semantic != VSOutputAttributes::INVALID) {
NGLOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}",
LOG_ERROR(Render_OpenGL, "Invalid/unknown semantic id: {}",
static_cast<u32>(semantic));
}
}
@ -320,7 +320,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un
case TexturingRegs::TextureConfig::ShadowCube:
return "shadowTextureCube(texcoord0, texcoord0_w)";
default:
NGLOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}",
LOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}",
static_cast<int>(state.texture0_type));
UNIMPLEMENTED();
return "texture(tex0, texcoord0)";
@ -336,7 +336,7 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un
if (state.proctex.enable) {
return "ProcTex()";
} else {
NGLOG_DEBUG(Render_OpenGL, "Using Texture3 without enabling it");
LOG_DEBUG(Render_OpenGL, "Using Texture3 without enabling it");
return "vec4(0.0)";
}
default:
@ -383,7 +383,7 @@ static void AppendSource(std::string& out, const PicaFSConfig& config,
break;
default:
out += "vec4(0.0)";
NGLOG_CRITICAL(Render_OpenGL, "Unknown source op {}", static_cast<u32>(source));
LOG_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)";
NGLOG_CRITICAL(Render_OpenGL, "Unknown color modifier op {}", static_cast<u32>(modifier));
LOG_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";
NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha modifier op {}", static_cast<u32>(modifier));
LOG_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)";
NGLOG_CRITICAL(Render_OpenGL, "Unknown color combiner operation: {}",
LOG_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";
NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha combiner operation: {}",
LOG_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";
NGLOG_CRITICAL(Render_OpenGL, "Unknown alpha test condition {}", static_cast<u32>(func));
LOG_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:
NGLOG_CRITICAL(HW_GPU, "Unknown lighting LUT input {}\n", (int)input);
LOG_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:
NGLOG_CRITICAL(HW_GPU, "Unknown shift mode {}", static_cast<u32>(mode));
LOG_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:
NGLOG_CRITICAL(HW_GPU, "Unknown clamp mode {}", static_cast<u32>(mode));
LOG_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:
NGLOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast<u32>(combiner));
LOG_CRITICAL(HW_GPU, "Unknown combiner {}", static_cast<u32>(combiner));
combined = "0.0";
break;
}
@ -1126,7 +1126,7 @@ float ProcTexNoiseCoef(vec2 x) {
if (config.state.proctex.coord < 3) {
out += "vec2 uv = abs(texcoord" + std::to_string(config.state.proctex.coord) + ");\n";
} else {
NGLOG_CRITICAL(Render_OpenGL, "Unexpected proctex.coord >= 3");
LOG_CRITICAL(Render_OpenGL, "Unexpected proctex.coord >= 3");
out += "vec2 uv = abs(texcoord0);\n";
}
@ -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);
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented gas mode");
LOG_CRITICAL(Render_OpenGL, "Unimplemented gas mode");
out += "discard; }";
return out;
}

View file

@ -28,7 +28,7 @@ GLuint LoadShader(const char* source, GLenum type) {
GLuint shader_id = glCreateShader(type);
glShaderSource(shader_id, 1, &source, nullptr);
NGLOG_DEBUG(Render_OpenGL, "Compiling {} shader...", debug_type);
LOG_DEBUG(Render_OpenGL, "Compiling {} shader...", debug_type);
glCompileShader(shader_id);
GLint result = GL_FALSE;
@ -40,11 +40,11 @@ GLuint LoadShader(const char* source, GLenum type) {
std::vector<char> shader_error(info_log_length);
glGetShaderInfoLog(shader_id, info_log_length, nullptr, &shader_error[0]);
if (result == GL_TRUE) {
NGLOG_DEBUG(Render_OpenGL, "{}", &shader_error[0]);
LOG_DEBUG(Render_OpenGL, "{}", &shader_error[0]);
} else {
NGLOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type,
LOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type,
&shader_error[0]);
NGLOG_ERROR(Render_OpenGL, "Shader source code:\n{}", source);
LOG_ERROR(Render_OpenGL, "Shader source code:\n{}", source);
}
}
return shader_id;
@ -52,7 +52,7 @@ GLuint LoadShader(const char* source, GLenum type) {
GLuint LoadProgram(bool separable_program, const std::vector<GLuint>& shaders) {
// Link the program
NGLOG_DEBUG(Render_OpenGL, "Linking program...");
LOG_DEBUG(Render_OpenGL, "Linking program...");
GLuint program_id = glCreateProgram();
@ -78,9 +78,9 @@ GLuint LoadProgram(bool separable_program, const std::vector<GLuint>& shaders) {
std::vector<char> program_error(info_log_length);
glGetProgramInfoLog(program_id, info_log_length, nullptr, &program_error[0]);
if (result == GL_TRUE) {
NGLOG_DEBUG(Render_OpenGL, "{}", &program_error[0]);
LOG_DEBUG(Render_OpenGL, "{}", &program_error[0]);
} else {
NGLOG_ERROR(Render_OpenGL, "Error linking shader:\n{}", &program_error[0]);
LOG_ERROR(Render_OpenGL, "Error linking shader:\n{}", &program_error[0]);
}
}

View file

@ -39,7 +39,7 @@ inline GLenum TextureFilterMode(Pica::TexturingRegs::TextureConfig::TextureFilte
// Range check table for input
if (index >= filter_mode_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index);
UNREACHABLE();
return GL_LINEAR;
@ -49,7 +49,7 @@ inline GLenum TextureFilterMode(Pica::TexturingRegs::TextureConfig::TextureFilte
// Check for dummy values indicating an unknown mode
if (gl_mode == 0) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode {}", index);
UNIMPLEMENTED();
return GL_LINEAR;
@ -76,7 +76,7 @@ inline GLenum WrapMode(Pica::TexturingRegs::TextureConfig::WrapMode mode) {
// Range check table for input
if (index >= wrap_mode_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index);
UNREACHABLE();
return GL_CLAMP_TO_EDGE;
@ -86,14 +86,14 @@ inline GLenum WrapMode(Pica::TexturingRegs::TextureConfig::WrapMode mode) {
Core::Telemetry().AddField(Telemetry::FieldType::Session,
"VideoCore_Pica_UnsupportedTextureWrapMode",
static_cast<u32>(index));
NGLOG_WARNING(Render_OpenGL, "Using texture wrap mode {}", index);
LOG_WARNING(Render_OpenGL, "Using texture wrap mode {}", index);
}
GLenum gl_mode = wrap_mode_table[index];
// Check for dummy values indicating an unknown mode
if (gl_mode == 0) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode {}", index);
UNIMPLEMENTED();
return GL_CLAMP_TO_EDGE;
@ -115,7 +115,7 @@ inline GLenum BlendEquation(Pica::FramebufferRegs::BlendEquation equation) {
// Range check table for input
if (index >= blend_equation_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown blend equation {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown blend equation {}", index);
// This return value is hwtested, not just a stub
return GL_FUNC_ADD;
@ -147,7 +147,7 @@ inline GLenum BlendFunc(Pica::FramebufferRegs::BlendFactor factor) {
// Range check table for input
if (index >= blend_func_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor {}", index);
UNREACHABLE();
return GL_ONE;
@ -180,7 +180,7 @@ inline GLenum LogicOp(Pica::FramebufferRegs::LogicOp op) {
// Range check table for input
if (index >= logic_op_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown logic op {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown logic op {}", index);
UNREACHABLE();
return GL_COPY;
@ -205,7 +205,7 @@ inline GLenum CompareFunc(Pica::FramebufferRegs::CompareFunc func) {
// Range check table for input
if (index >= compare_func_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown compare function {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown compare function {}", index);
UNREACHABLE();
return GL_ALWAYS;
@ -230,7 +230,7 @@ inline GLenum StencilOp(Pica::FramebufferRegs::StencilAction action) {
// Range check table for input
if (index >= stencil_op_table.size()) {
NGLOG_CRITICAL(Render_OpenGL, "Unknown stencil op {}", index);
LOG_CRITICAL(Render_OpenGL, "Unknown stencil op {}", index);
UNREACHABLE();
return GL_KEEP;

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);
NGLOG_TRACE(Render_OpenGL, "0x{:08x} bytes from 0x{:08x}({}x{}), fmt {:x}",
LOG_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,7 +494,7 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum
level = Log::Level::Debug;
break;
}
NGLOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source),
LOG_GENERIC(Log::Class::Render_OpenGL, level, "{} {} {}: {}", GetSource(source),
GetType(type), id, message);
}
@ -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))};
NGLOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
NGLOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
NGLOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
LOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
LOG_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);