renderer_opengl: Logging, etc. cleanup.

This commit is contained in:
bunnei 2018-03-24 22:38:08 -04:00
parent 7504df52fc
commit 0a5832798a
6 changed files with 34 additions and 33 deletions

View File

@ -20,6 +20,7 @@
#include "video_core/engines/maxwell_3d.h" #include "video_core/engines/maxwell_3d.h"
#include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/gl_shader_gen.h"
#include "video_core/renderer_opengl/maxwell_to_gl.h"
#include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/renderer_opengl/renderer_opengl.h"
using Maxwell = Tegra::Engines::Maxwell3D::Regs; using Maxwell = Tegra::Engines::Maxwell3D::Regs;
@ -124,14 +125,14 @@ RasterizerOpenGL::RasterizerOpenGL() {
glBufferData(GL_UNIFORM_BUFFER, sizeof(VSUniformData), nullptr, GL_STREAM_COPY); glBufferData(GL_UNIFORM_BUFFER, sizeof(VSUniformData), nullptr, GL_STREAM_COPY);
glBindBufferBase(GL_UNIFORM_BUFFER, 1, vs_uniform_buffer.handle); glBindBufferBase(GL_UNIFORM_BUFFER, 1, vs_uniform_buffer.handle);
} else { } else {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
accelerate_draw = AccelDraw::Disabled; accelerate_draw = AccelDraw::Disabled;
glEnable(GL_BLEND); glEnable(GL_BLEND);
LOG_WARNING(HW_GPU, "Sync fixed function OpenGL state here when ready"); LOG_CRITICAL(Render_OpenGL, "Sync fixed function OpenGL state here!");
} }
RasterizerOpenGL::~RasterizerOpenGL() { RasterizerOpenGL::~RasterizerOpenGL() {
@ -200,12 +201,12 @@ void RasterizerOpenGL::SetupVertexShader(VSUniformData* ub_ptr, GLintptr buffer_
void RasterizerOpenGL::SetupFragmentShader(FSUniformData* ub_ptr, GLintptr buffer_offset) { void RasterizerOpenGL::SetupFragmentShader(FSUniformData* ub_ptr, GLintptr buffer_offset) {
MICROPROFILE_SCOPE(OpenGL_FS); MICROPROFILE_SCOPE(OpenGL_FS);
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
bool RasterizerOpenGL::AccelerateDrawBatch(bool is_indexed) { bool RasterizerOpenGL::AccelerateDrawBatch(bool is_indexed) {
if (!has_ARB_separate_shader_objects) { if (!has_ARB_separate_shader_objects) {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
return false; return false;
} }
@ -438,17 +439,17 @@ void RasterizerOpenGL::FlushAndInvalidateRegion(VAddr addr, u64 size) {
bool RasterizerOpenGL::AccelerateDisplayTransfer(const void* config) { bool RasterizerOpenGL::AccelerateDisplayTransfer(const void* config) {
MICROPROFILE_SCOPE(OpenGL_Blits); MICROPROFILE_SCOPE(OpenGL_Blits);
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
return true; return true;
} }
bool RasterizerOpenGL::AccelerateTextureCopy(const void* config) { bool RasterizerOpenGL::AccelerateTextureCopy(const void* config) {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
return true; return true;
} }
bool RasterizerOpenGL::AccelerateFill(const void* config) { bool RasterizerOpenGL::AccelerateFill(const void* config) {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
return true; return true;
} }
@ -529,14 +530,14 @@ void main() {
return; return;
} }
LOG_ERROR(HW_GPU, "Emulated shaders are not supported! Using a passthrough shader."); LOG_CRITICAL(Render_OpenGL, "Emulated shaders are not supported! Using a passthrough shader.");
current_shader = &test_shader; current_shader = &test_shader;
if (has_ARB_separate_shader_objects) { if (has_ARB_separate_shader_objects) {
test_shader.shader.Create(vertex_shader, nullptr, fragment_shader, {}, true); test_shader.shader.Create(vertex_shader, nullptr, fragment_shader, {}, true);
glActiveShaderProgram(pipeline.handle, test_shader.shader.handle); glActiveShaderProgram(pipeline.handle, test_shader.shader.handle);
} else { } else {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
state.draw.shader_program = test_shader.shader.handle; state.draw.shader_program = test_shader.shader.handle;
@ -549,33 +550,33 @@ void main() {
} }
void RasterizerOpenGL::SyncClipEnabled() { void RasterizerOpenGL::SyncClipEnabled() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncClipCoef() { void RasterizerOpenGL::SyncClipCoef() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncCullMode() { void RasterizerOpenGL::SyncCullMode() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncDepthScale() { void RasterizerOpenGL::SyncDepthScale() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncDepthOffset() { void RasterizerOpenGL::SyncDepthOffset() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncBlendEnabled() { void RasterizerOpenGL::SyncBlendEnabled() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncBlendFuncs() { void RasterizerOpenGL::SyncBlendFuncs() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }
void RasterizerOpenGL::SyncBlendColor() { void RasterizerOpenGL::SyncBlendColor() {
ASSERT_MSG(false, "Unimplemented"); UNREACHABLE();
} }

View File

@ -26,7 +26,7 @@ public:
sanitize_mul(sanitize_mul), emit_cb(emit_cb), setemit_cb(setemit_cb) {} sanitize_mul(sanitize_mul), emit_cb(emit_cb), setemit_cb(setemit_cb) {}
std::string Decompile() { std::string Decompile() {
UNIMPLEMENTED(); UNREACHABLE();
return {}; return {};
} }

View File

@ -8,12 +8,12 @@
namespace GLShader { namespace GLShader {
std::string GenerateVertexShader(const MaxwellVSConfig& config) { std::string GenerateVertexShader(const MaxwellVSConfig& config) {
UNIMPLEMENTED(); UNREACHABLE();
return {}; return {};
} }
std::string GenerateFragmentShader(const MaxwellFSConfig& config) { std::string GenerateFragmentShader(const MaxwellFSConfig& config) {
UNIMPLEMENTED(); UNREACHABLE();
return {}; return {};
} }

View File

@ -38,7 +38,7 @@ GLuint LoadProgram(const char* vertex_shader, const char* geometry_shader,
if (result == GL_TRUE) { if (result == GL_TRUE) {
LOG_DEBUG(Render_OpenGL, "%s", &vertex_shader_error[0]); LOG_DEBUG(Render_OpenGL, "%s", &vertex_shader_error[0]);
} else { } else {
LOG_ERROR(Render_OpenGL, "Error compiling vertex shader:\n%s", LOG_CRITICAL(Render_OpenGL, "Error compiling vertex shader:\n%s",
&vertex_shader_error[0]); &vertex_shader_error[0]);
} }
} }
@ -62,7 +62,7 @@ GLuint LoadProgram(const char* vertex_shader, const char* geometry_shader,
if (result == GL_TRUE) { if (result == GL_TRUE) {
LOG_DEBUG(Render_OpenGL, "%s", &geometry_shader_error[0]); LOG_DEBUG(Render_OpenGL, "%s", &geometry_shader_error[0]);
} else { } else {
LOG_ERROR(Render_OpenGL, "Error compiling geometry shader:\n%s", LOG_CRITICAL(Render_OpenGL, "Error compiling geometry shader:\n%s",
&geometry_shader_error[0]); &geometry_shader_error[0]);
} }
} }
@ -86,7 +86,7 @@ GLuint LoadProgram(const char* vertex_shader, const char* geometry_shader,
if (result == GL_TRUE) { if (result == GL_TRUE) {
LOG_DEBUG(Render_OpenGL, "%s", &fragment_shader_error[0]); LOG_DEBUG(Render_OpenGL, "%s", &fragment_shader_error[0]);
} else { } else {
LOG_ERROR(Render_OpenGL, "Error compiling fragment shader:\n%s", LOG_CRITICAL(Render_OpenGL, "Error compiling fragment shader:\n%s",
&fragment_shader_error[0]); &fragment_shader_error[0]);
} }
} }
@ -128,20 +128,20 @@ GLuint LoadProgram(const char* vertex_shader, const char* geometry_shader,
if (result == GL_TRUE) { if (result == GL_TRUE) {
LOG_DEBUG(Render_OpenGL, "%s", &program_error[0]); LOG_DEBUG(Render_OpenGL, "%s", &program_error[0]);
} else { } else {
LOG_ERROR(Render_OpenGL, "Error linking shader:\n%s", &program_error[0]); LOG_CRITICAL(Render_OpenGL, "Error linking shader:\n%s", &program_error[0]);
} }
} }
// If the program linking failed at least one of the shaders was probably bad // If the program linking failed at least one of the shaders was probably bad
if (result == GL_FALSE) { if (result == GL_FALSE) {
if (vertex_shader) { if (vertex_shader) {
LOG_ERROR(Render_OpenGL, "Vertex shader:\n%s", vertex_shader); LOG_CRITICAL(Render_OpenGL, "Vertex shader:\n%s", vertex_shader);
} }
if (geometry_shader) { if (geometry_shader) {
LOG_ERROR(Render_OpenGL, "Geometry shader:\n%s", geometry_shader); LOG_CRITICAL(Render_OpenGL, "Geometry shader:\n%s", geometry_shader);
} }
if (fragment_shader) { if (fragment_shader) {
LOG_ERROR(Render_OpenGL, "Fragment shader:\n%s", fragment_shader); LOG_CRITICAL(Render_OpenGL, "Fragment shader:\n%s", fragment_shader);
} }
} }
ASSERT_MSG(result == GL_TRUE, "Shader not linked"); ASSERT_MSG(result == GL_TRUE, "Shader not linked");

View File

@ -279,7 +279,7 @@ void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
gl_framebuffer_data.resize(texture.width * texture.height * 4); gl_framebuffer_data.resize(texture.width * texture.height * 4);
break; break;
default: default:
UNIMPLEMENTED(); UNREACHABLE();
} }
state.texture_units[0].texture_2d = texture.resource.handle; state.texture_units[0].texture_2d = texture.resource.handle;
@ -305,7 +305,7 @@ void RendererOpenGL::DrawSingleScreen(const ScreenInfo& screen_info, float x, fl
right = texcoords.left; right = texcoords.left;
} else { } else {
// Other transformations are unsupported // Other transformations are unsupported
LOG_CRITICAL(HW_GPU, "unsupported framebuffer_transform_flags=%d", LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags=%d",
framebuffer_transform_flags); framebuffer_transform_flags);
UNIMPLEMENTED(); UNIMPLEMENTED();
} }

View File

@ -26,7 +26,7 @@ bool Init(EmuWindow* emu_window) {
if (g_renderer->Init()) { if (g_renderer->Init()) {
LOG_DEBUG(Render, "initialized OK"); LOG_DEBUG(Render, "initialized OK");
} else { } else {
LOG_ERROR(Render, "initialization failed !"); LOG_CRITICAL(Render, "initialization failed !");
return false; return false;
} }
return true; return true;