Merge pull request #607 from jroweboy/logging
Logging - Customizable backends
This commit is contained in:
commit
15e68cdbaa
116 changed files with 1261 additions and 887 deletions
|
@ -29,21 +29,21 @@ enum class BufferMethods {
|
|||
};
|
||||
|
||||
void GPU::WriteReg(u32 method, u32 subchannel, u32 value, u32 remaining_params) {
|
||||
NGLOG_WARNING(HW_GPU,
|
||||
"Processing method {:08X} on subchannel {} value "
|
||||
"{:08X} remaining params {}",
|
||||
method, subchannel, value, remaining_params);
|
||||
LOG_WARNING(HW_GPU,
|
||||
"Processing method {:08X} on subchannel {} value "
|
||||
"{:08X} remaining params {}",
|
||||
method, subchannel, value, remaining_params);
|
||||
|
||||
if (method == static_cast<u32>(BufferMethods::BindObject)) {
|
||||
// Bind the current subchannel to the desired engine id.
|
||||
NGLOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value);
|
||||
LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", subchannel, value);
|
||||
bound_engines[subchannel] = static_cast<EngineID>(value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (method < static_cast<u32>(BufferMethods::CountBufferMethods)) {
|
||||
// TODO(Subv): Research and implement these methods.
|
||||
NGLOG_ERROR(HW_GPU, "Special buffer methods other than Bind are not implemented");
|
||||
LOG_ERROR(HW_GPU, "Special buffer methods other than Bind are not implemented");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ void Fermi2D::WriteReg(u32 method, u32 value) {
|
|||
}
|
||||
|
||||
void Fermi2D::HandleSurfaceCopy() {
|
||||
NGLOG_WARNING(HW_GPU, "Requested a surface copy with operation {}",
|
||||
static_cast<u32>(regs.operation));
|
||||
LOG_WARNING(HW_GPU, "Requested a surface copy with operation {}",
|
||||
static_cast<u32>(regs.operation));
|
||||
|
||||
const GPUVAddr source = regs.src.Address();
|
||||
const GPUVAddr dest = regs.dst.Address();
|
||||
|
|
|
@ -207,8 +207,8 @@ void Maxwell3D::ProcessQueryGet() {
|
|||
}
|
||||
|
||||
void Maxwell3D::DrawArrays() {
|
||||
NGLOG_DEBUG(HW_GPU, "called, topology={}, count={}",
|
||||
static_cast<u32>(regs.draw.topology.Value()), regs.vertex_buffer.count);
|
||||
LOG_DEBUG(HW_GPU, "called, topology={}, count={}", static_cast<u32>(regs.draw.topology.Value()),
|
||||
regs.vertex_buffer.count);
|
||||
ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?");
|
||||
|
||||
auto debug_context = Core::System::GetInstance().GetGPUDebugContext();
|
||||
|
|
|
@ -31,7 +31,7 @@ void MaxwellDMA::WriteReg(u32 method, u32 value) {
|
|||
}
|
||||
|
||||
void MaxwellDMA::HandleCopy() {
|
||||
NGLOG_WARNING(HW_GPU, "Requested a DMA copy");
|
||||
LOG_WARNING(HW_GPU, "Requested a DMA copy");
|
||||
|
||||
const GPUVAddr source = regs.src_address.Address();
|
||||
const GPUVAddr dest = regs.dst_address.Address();
|
||||
|
|
|
@ -112,7 +112,7 @@ RasterizerOpenGL::RasterizerOpenGL() {
|
|||
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!");
|
||||
LOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!");
|
||||
}
|
||||
|
||||
RasterizerOpenGL::~RasterizerOpenGL() {
|
||||
|
@ -165,9 +165,9 @@ std::pair<u8*, GLintptr> RasterizerOpenGL::SetupVertexArrays(u8* array_ptr,
|
|||
// assume every shader uses them all.
|
||||
for (unsigned index = 0; index < 16; ++index) {
|
||||
auto& attrib = regs.vertex_attrib_format[index];
|
||||
NGLOG_DEBUG(HW_GPU, "vertex attrib {}, count={}, size={}, type={}, offset={}, normalize={}",
|
||||
index, attrib.ComponentCount(), attrib.SizeString(), attrib.TypeString(),
|
||||
attrib.offset.Value(), attrib.IsNormalized());
|
||||
LOG_DEBUG(HW_GPU, "vertex attrib {}, count={}, size={}, type={}, offset={}, normalize={}",
|
||||
index, attrib.ComponentCount(), attrib.SizeString(), attrib.TypeString(),
|
||||
attrib.offset.Value(), attrib.IsNormalized());
|
||||
|
||||
auto& buffer = regs.vertex_array[attrib.buffer];
|
||||
ASSERT(buffer.IsEnabled());
|
||||
|
@ -251,8 +251,8 @@ void RasterizerOpenGL::SetupShaders(u8* buffer_ptr, GLintptr buffer_offset) {
|
|||
break;
|
||||
}
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset=0x{:08X}",
|
||||
index, shader_config.enable.Value(), shader_config.offset);
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented shader index={}, enable={}, offset=0x{:08X}", index,
|
||||
shader_config.enable.Value(), shader_config.offset);
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
|
@ -587,8 +587,8 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, GLuint progr
|
|||
size = buffer.size * sizeof(float);
|
||||
|
||||
if (size > MaxConstbufferSize) {
|
||||
NGLOG_ERROR(HW_GPU, "indirect constbuffer size {} exceeds maximum {}", size,
|
||||
MaxConstbufferSize);
|
||||
LOG_ERROR(HW_GPU, "indirect constbuffer size {} exceeds maximum {}", size,
|
||||
MaxConstbufferSize);
|
||||
size = MaxConstbufferSize;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -117,7 +117,7 @@ static std::pair<u32, u32> GetASTCBlockSize(PixelFormat format) {
|
|||
case PixelFormat::ASTC_2D_4X4:
|
||||
return {4, 4};
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled format: {}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled format: {}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ void MortonCopy(u32 stride, u32 block_height, u32 height, u8* gl_buffer, Tegra::
|
|||
} else {
|
||||
// TODO(bunnei): Assumes the default rendering GOB size of 16 (128 lines). We should
|
||||
// check the configuration for this and perform more generic un/swizzle
|
||||
NGLOG_WARNING(Render_OpenGL, "need to use correct swizzle/GOB parameters!");
|
||||
LOG_WARNING(Render_OpenGL, "need to use correct swizzle/GOB parameters!");
|
||||
VideoCore::MortonCopyPixels128(
|
||||
stride, height, bytes_per_pixel, gl_bytes_per_pixel,
|
||||
Memory::GetPointer(*gpu.memory_manager->GpuToCpuAddress(addr)), gl_buffer,
|
||||
|
@ -396,7 +396,7 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces(
|
|||
const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
|
||||
|
||||
// TODO(bunnei): This is hard corded to use just the first render buffer
|
||||
NGLOG_WARNING(Render_OpenGL, "hard-coded for render target 0!");
|
||||
LOG_WARNING(Render_OpenGL, "hard-coded for render target 0!");
|
||||
|
||||
// get color and depth surfaces
|
||||
const SurfaceParams color_params{SurfaceParams::CreateForFramebuffer(regs.rt[0])};
|
||||
|
|
|
@ -131,7 +131,7 @@ struct SurfaceParams {
|
|||
case Tegra::DepthFormat::Z24_S8_UNORM:
|
||||
return PixelFormat::Z24S8;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ struct SurfaceParams {
|
|||
case Tegra::RenderTargetFormat::RGBA32_UINT:
|
||||
return PixelFormat::RGBA32UI;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ struct SurfaceParams {
|
|||
case Tegra::Texture::TextureFormat::ASTC_2D_4X4:
|
||||
return PixelFormat::ASTC_2D_4X4;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ struct SurfaceParams {
|
|||
case Tegra::Texture::ComponentType::UNORM:
|
||||
return ComponentType::UNorm;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented component type={}", static_cast<u32>(type));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ struct SurfaceParams {
|
|||
case Tegra::RenderTargetFormat::RGBA32_UINT:
|
||||
return ComponentType::UInt;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -267,7 +267,7 @@ struct SurfaceParams {
|
|||
case Tegra::FramebufferConfig::PixelFormat::ABGR8:
|
||||
return PixelFormat::ABGR8;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ struct SurfaceParams {
|
|||
case Tegra::DepthFormat::Z24_S8_UNORM:
|
||||
return ComponentType::UNorm;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented format={}", static_cast<u32>(format));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ public:
|
|||
// Default - do nothing
|
||||
return value;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented conversion size {}", static_cast<u32>(size));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented conversion size {}", static_cast<u32>(size));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ private:
|
|||
return "input_attribute_" + std::to_string(index);
|
||||
}
|
||||
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled input attribute: {}", index);
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled input attribute: {}", index);
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ private:
|
|||
return "output_attribute_" + std::to_string(index);
|
||||
}
|
||||
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled output attribute: {}", index);
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled output attribute: {}", index);
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -797,7 +797,7 @@ private:
|
|||
break;
|
||||
}
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented logic operation: {}", static_cast<u32>(logic_op));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented logic operation: {}", static_cast<u32>(logic_op));
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ private:
|
|||
|
||||
// Decoding failure
|
||||
if (!opcode) {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled instruction: {0:x}", instr.value);
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled instruction: {0:x}", instr.value);
|
||||
UNREACHABLE();
|
||||
return offset + 1;
|
||||
}
|
||||
|
@ -922,8 +922,8 @@ private:
|
|||
instr.alu.saturate_d);
|
||||
break;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled MUFU sub op: {0:x}",
|
||||
static_cast<unsigned>(instr.sub_op.Value()));
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled MUFU sub op: {0:x}",
|
||||
static_cast<unsigned>(instr.sub_op.Value()));
|
||||
UNREACHABLE();
|
||||
}
|
||||
break;
|
||||
|
@ -946,11 +946,11 @@ private:
|
|||
// Currently RRO is only implemented as a register move.
|
||||
// Usage of `abs_b` and `negate_b` here should also be correct.
|
||||
regs.SetRegisterToFloat(instr.gpr0, 0, op_b, 1, 1);
|
||||
NGLOG_WARNING(HW_GPU, "RRO instruction is incomplete");
|
||||
LOG_WARNING(HW_GPU, "RRO instruction is incomplete");
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled arithmetic instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled arithmetic instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -989,7 +989,7 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled BFE instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled BFE instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1032,7 +1032,7 @@ private:
|
|||
regs.SetRegisterToInteger(instr.gpr0, true, 0, op_a + " << " + op_b, 1, 1);
|
||||
break;
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled shift instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled shift instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1062,8 +1062,8 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled ArithmeticIntegerImmediate instruction: {}",
|
||||
opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled ArithmeticIntegerImmediate instruction: {}",
|
||||
opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1128,8 +1128,8 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled ArithmeticInteger instruction: {}",
|
||||
opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled ArithmeticInteger instruction: {}",
|
||||
opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1165,7 +1165,7 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled FFMA instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled FFMA instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1223,8 +1223,8 @@ private:
|
|||
op_a = "trunc(" + op_a + ')';
|
||||
break;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented f2f rounding mode {}",
|
||||
static_cast<u32>(instr.conversion.f2f.rounding.Value()));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented f2f rounding mode {}",
|
||||
static_cast<u32>(instr.conversion.f2f.rounding.Value()));
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
@ -1257,8 +1257,8 @@ private:
|
|||
op_a = "trunc(" + op_a + ')';
|
||||
break;
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unimplemented f2i rounding mode {}",
|
||||
static_cast<u32>(instr.conversion.f2i.rounding.Value()));
|
||||
LOG_CRITICAL(HW_GPU, "Unimplemented f2i rounding mode {}",
|
||||
static_cast<u32>(instr.conversion.f2i.rounding.Value()));
|
||||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
@ -1274,7 +1274,7 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled conversion instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled conversion instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1309,8 +1309,8 @@ private:
|
|||
break;
|
||||
|
||||
default:
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled type: {}",
|
||||
static_cast<unsigned>(instr.ld_c.type.Value()));
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled type: {}",
|
||||
static_cast<unsigned>(instr.ld_c.type.Value()));
|
||||
UNREACHABLE();
|
||||
}
|
||||
break;
|
||||
|
@ -1383,7 +1383,7 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled memory instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled memory instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1600,7 +1600,7 @@ private:
|
|||
break;
|
||||
}
|
||||
default: {
|
||||
NGLOG_CRITICAL(HW_GPU, "Unhandled instruction: {}", opcode->GetName());
|
||||
LOG_CRITICAL(HW_GPU, "Unhandled instruction: {}", opcode->GetName());
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
@ -1740,7 +1740,7 @@ boost::optional<ProgramResult> DecompileProgram(const ProgramCode& program_code,
|
|||
GLSLGenerator generator(subroutines, program_code, main_offset, stage);
|
||||
return ProgramResult{generator.GetShaderCode(), generator.GetEntries()};
|
||||
} catch (const DecompileFail& exception) {
|
||||
NGLOG_ERROR(HW_GPU, "Shader decompilation failed: {}", exception.what());
|
||||
LOG_ERROR(HW_GPU, "Shader decompilation failed: {}", exception.what());
|
||||
}
|
||||
return boost::none;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,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;
|
||||
|
@ -39,9 +39,9 @@ GLuint LoadShader(const char* source, GLenum type) {
|
|||
std::string 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);
|
||||
LOG_DEBUG(Render_OpenGL, "{}", shader_error);
|
||||
} else {
|
||||
NGLOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type, shader_error);
|
||||
LOG_ERROR(Render_OpenGL, "Error compiling {} shader:\n{}", debug_type, shader_error);
|
||||
}
|
||||
}
|
||||
return shader_id;
|
||||
|
|
|
@ -29,7 +29,7 @@ void LogShaderSource(T... shaders) {
|
|||
|
||||
std::string source(source_length, ' ');
|
||||
glGetShaderSource(shader, source_length, nullptr, &source[0]);
|
||||
NGLOG_INFO(Render_OpenGL, "Shader source {}", source);
|
||||
LOG_INFO(Render_OpenGL, "Shader source {}", source);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ GLuint LoadShader(const char* source, GLenum type);
|
|||
template <typename... T>
|
||||
GLuint LoadProgram(bool separable_program, T... shaders) {
|
||||
// Link the program
|
||||
NGLOG_DEBUG(Render_OpenGL, "Linking program...");
|
||||
LOG_DEBUG(Render_OpenGL, "Linking program...");
|
||||
|
||||
GLuint program_id = glCreateProgram();
|
||||
|
||||
|
@ -71,9 +71,9 @@ GLuint LoadProgram(bool separable_program, T... shaders) {
|
|||
std::string 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);
|
||||
LOG_DEBUG(Render_OpenGL, "{}", program_error);
|
||||
} else {
|
||||
NGLOG_ERROR(Render_OpenGL, "Error linking shader:\n{}", program_error);
|
||||
LOG_ERROR(Render_OpenGL, "Error linking shader:\n{}", program_error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
|
|||
return GL_UNSIGNED_BYTE;
|
||||
}
|
||||
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
|
|||
return GL_BYTE;
|
||||
}
|
||||
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
|
|||
return GL_FLOAT;
|
||||
}
|
||||
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type={}", attrib.TypeString());
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type={}", attrib.TypeString());
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ inline GLenum IndexFormat(Maxwell::IndexFormat index_format) {
|
|||
case Maxwell::IndexFormat::UnsignedInt:
|
||||
return GL_UNSIGNED_INT;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented index_format={}", static_cast<u32>(index_format));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented index_format={}", static_cast<u32>(index_format));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
|
|||
case Maxwell::PrimitiveTopology::TriangleStrip:
|
||||
return GL_TRIANGLE_STRIP;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented topology={}", static_cast<u32>(topology));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented topology={}", static_cast<u32>(topology));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -90,8 +90,8 @@ inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode) {
|
|||
case Tegra::Texture::TextureFilter::Nearest:
|
||||
return GL_NEAREST;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented texture filter mode={}",
|
||||
static_cast<u32>(filter_mode));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented texture filter mode={}",
|
||||
static_cast<u32>(filter_mode));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -110,8 +110,7 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
|
|||
// manually mix them. However the shader part of this is not yet implemented.
|
||||
return GL_CLAMP_TO_BORDER;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode={}",
|
||||
static_cast<u32>(wrap_mode));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -129,7 +128,7 @@ inline GLenum BlendEquation(Maxwell::Blend::Equation equation) {
|
|||
case Maxwell::Blend::Equation::Max:
|
||||
return GL_MAX;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented blend equation={}", static_cast<u32>(equation));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented blend equation={}", static_cast<u32>(equation));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -175,7 +174,7 @@ inline GLenum BlendFunc(Maxwell::Blend::Factor factor) {
|
|||
case Maxwell::Blend::Factor::OneMinusConstantAlpha:
|
||||
return GL_ONE_MINUS_CONSTANT_ALPHA;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented blend factor={}", static_cast<u32>(factor));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented blend factor={}", static_cast<u32>(factor));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -196,7 +195,7 @@ inline GLenum SwizzleSource(Tegra::Texture::SwizzleSource source) {
|
|||
case Tegra::Texture::SwizzleSource::OneFloat:
|
||||
return GL_ONE;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented swizzle source={}", static_cast<u32>(source));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented swizzle source={}", static_cast<u32>(source));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -220,7 +219,7 @@ inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) {
|
|||
case Maxwell::ComparisonOp::Always:
|
||||
return GL_ALWAYS;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented comparison op={}", static_cast<u32>(comparison));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented comparison op={}", static_cast<u32>(comparison));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -232,7 +231,7 @@ inline GLenum FrontFace(Maxwell::Cull::FrontFace front_face) {
|
|||
case Maxwell::Cull::FrontFace::CounterClockWise:
|
||||
return GL_CCW;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented front face cull={}", static_cast<u32>(front_face));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented front face cull={}", static_cast<u32>(front_face));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
@ -246,7 +245,7 @@ inline GLenum CullFace(Maxwell::Cull::CullFace cull_face) {
|
|||
case Maxwell::Cull::CullFace::FrontAndBack:
|
||||
return GL_FRONT_AND_BACK;
|
||||
}
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unimplemented cull face={}", static_cast<u32>(cull_face));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented cull face={}", static_cast<u32>(cull_face));
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
|
|
@ -301,8 +301,8 @@ void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x,
|
|||
right = texcoords.left;
|
||||
} else {
|
||||
// Other transformations are unsupported
|
||||
NGLOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
|
||||
static_cast<u32>(framebuffer_transform_flags));
|
||||
LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
|
||||
static_cast<u32>(framebuffer_transform_flags));
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
}
|
||||
|
@ -404,14 +404,14 @@ static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum
|
|||
|
||||
switch (severity) {
|
||||
case GL_DEBUG_SEVERITY_HIGH:
|
||||
NGLOG_ERROR(Render_OpenGL, format, str_source, str_type, id, message);
|
||||
LOG_ERROR(Render_OpenGL, format, str_source, str_type, id, message);
|
||||
break;
|
||||
case GL_DEBUG_SEVERITY_MEDIUM:
|
||||
NGLOG_WARNING(Render_OpenGL, format, str_source, str_type, id, message);
|
||||
LOG_WARNING(Render_OpenGL, format, str_source, str_type, id, message);
|
||||
break;
|
||||
case GL_DEBUG_SEVERITY_NOTIFICATION:
|
||||
case GL_DEBUG_SEVERITY_LOW:
|
||||
NGLOG_DEBUG(Render_OpenGL, format, str_source, str_type, id, message);
|
||||
LOG_DEBUG(Render_OpenGL, format, str_source, str_type, id, message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -429,9 +429,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);
|
||||
|
|
|
@ -24,9 +24,9 @@ bool Init(EmuWindow* emu_window) {
|
|||
g_renderer = std::make_unique<RendererOpenGL>();
|
||||
g_renderer->SetWindow(g_emu_window);
|
||||
if (g_renderer->Init()) {
|
||||
NGLOG_DEBUG(Render, "initialized OK");
|
||||
LOG_DEBUG(Render, "initialized OK");
|
||||
} else {
|
||||
NGLOG_CRITICAL(Render, "initialization failed !");
|
||||
LOG_CRITICAL(Render, "initialization failed !");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -36,7 +36,7 @@ bool Init(EmuWindow* emu_window) {
|
|||
void Shutdown() {
|
||||
g_renderer.reset();
|
||||
|
||||
NGLOG_DEBUG(Render, "shutdown OK");
|
||||
LOG_DEBUG(Render, "shutdown OK");
|
||||
}
|
||||
|
||||
} // namespace VideoCore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue