summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar Lioncash2020-12-07 00:41:47 -0500
committerGravatar Lioncash2020-12-07 00:41:50 -0500
commit4c5f5c9bf301d3626df104dbed6fed6f115cedc8 (patch)
tree968245c43735e546fff2a8c7dcecfe653dee33fd /src/video_core/renderer_opengl
parentMerge pull request #5147 from comex/xx-purevirt (diff)
downloadyuzu-4c5f5c9bf301d3626df104dbed6fed6f115cedc8.tar.gz
yuzu-4c5f5c9bf301d3626df104dbed6fed6f115cedc8.tar.xz
yuzu-4c5f5c9bf301d3626df104dbed6fed6f115cedc8.zip
video_core: Remove unnecessary enum class casting in logging messages
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more. Reduces the line noise a bit.
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_arb_decompiler.cpp8
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp3
-rw-r--r--src/video_core/renderer_opengl/maxwell_to_gl.h30
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp2
6 files changed, 27 insertions, 28 deletions
diff --git a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
index 5378c398e..78066cc63 100644
--- a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
@@ -71,7 +71,7 @@ std::string_view GetInputFlags(PixelImap attribute) {
71 case PixelImap::Unused: 71 case PixelImap::Unused:
72 break; 72 break;
73 } 73 }
74 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", static_cast<int>(attribute)); 74 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", attribute);
75 return {}; 75 return {};
76} 76}
77 77
@@ -123,7 +123,7 @@ std::string_view PrimitiveDescription(Tegra::Engines::Maxwell3D::Regs::Primitive
123 case Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology::TriangleStripAdjacency: 123 case Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology::TriangleStripAdjacency:
124 return "TRIANGLES_ADJACENCY"; 124 return "TRIANGLES_ADJACENCY";
125 default: 125 default:
126 UNIMPLEMENTED_MSG("topology={}", static_cast<int>(topology)); 126 UNIMPLEMENTED_MSG("topology={}", topology);
127 return "POINTS"; 127 return "POINTS";
128 } 128 }
129} 129}
@@ -137,7 +137,7 @@ std::string_view TopologyName(Tegra::Shader::OutputTopology topology) {
137 case Tegra::Shader::OutputTopology::TriangleStrip: 137 case Tegra::Shader::OutputTopology::TriangleStrip:
138 return "TRIANGLE_STRIP"; 138 return "TRIANGLE_STRIP";
139 default: 139 default:
140 UNIMPLEMENTED_MSG("Unknown output topology: {}", static_cast<u32>(topology)); 140 UNIMPLEMENTED_MSG("Unknown output topology: {}", topology);
141 return "points"; 141 return "points";
142 } 142 }
143} 143}
@@ -1351,7 +1351,7 @@ std::string ARBDecompiler::Visit(const Node& node) {
1351 GetGenericAttributeIndex(index), swizzle); 1351 GetGenericAttributeIndex(index), swizzle);
1352 } 1352 }
1353 } 1353 }
1354 UNIMPLEMENTED_MSG("Unimplemented input attribute={}", static_cast<int>(index)); 1354 UNIMPLEMENTED_MSG("Unimplemented input attribute={}", index);
1355 break; 1355 break;
1356 } 1356 }
1357 return "{0, 0, 0, 0}.x"; 1357 return "{0, 0, 0, 0}.x";
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 8572af5a5..e58e84759 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -131,7 +131,7 @@ std::pair<GLint, GLint> TransformFeedbackEnum(u8 location) {
131 case 43: 131 case 43:
132 return {GL_BACK_SECONDARY_COLOR_NV, 0}; 132 return {GL_BACK_SECONDARY_COLOR_NV, 0};
133 } 133 }
134 UNIMPLEMENTED_MSG("index={}", static_cast<int>(index)); 134 UNIMPLEMENTED_MSG("index={}", index);
135 return {GL_POSITION, 0}; 135 return {GL_POSITION, 0};
136} 136}
137 137
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 0940969ba..0c97a8988 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -316,7 +316,7 @@ std::pair<const char*, u32> GetPrimitiveDescription(Maxwell::PrimitiveTopology t
316 case Maxwell::PrimitiveTopology::TriangleStripAdjacency: 316 case Maxwell::PrimitiveTopology::TriangleStripAdjacency:
317 return {"triangles_adjacency", 6}; 317 return {"triangles_adjacency", 6};
318 default: 318 default:
319 UNIMPLEMENTED_MSG("topology={}", static_cast<int>(topology)); 319 UNIMPLEMENTED_MSG("topology={}", topology);
320 return {"points", 1}; 320 return {"points", 1};
321 } 321 }
322} 322}
@@ -342,7 +342,7 @@ std::string GetTopologyName(Tegra::Shader::OutputTopology topology) {
342 case Tegra::Shader::OutputTopology::TriangleStrip: 342 case Tegra::Shader::OutputTopology::TriangleStrip:
343 return "triangle_strip"; 343 return "triangle_strip";
344 default: 344 default:
345 UNIMPLEMENTED_MSG("Unknown output topology: {}", static_cast<u32>(topology)); 345 UNIMPLEMENTED_MSG("Unknown output topology: {}", topology);
346 return "points"; 346 return "points";
347 } 347 }
348} 348}
@@ -745,7 +745,7 @@ private:
745 case PixelImap::Unused: 745 case PixelImap::Unused:
746 break; 746 break;
747 } 747 }
748 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", static_cast<int>(attribute)); 748 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", attribute);
749 return {}; 749 return {};
750 } 750 }
751 751
@@ -1252,7 +1252,7 @@ private:
1252 } 1252 }
1253 break; 1253 break;
1254 } 1254 }
1255 UNIMPLEMENTED_MSG("Unhandled input attribute: {}", static_cast<u32>(attribute)); 1255 UNIMPLEMENTED_MSG("Unhandled input attribute: {}", attribute);
1256 return {"0", Type::Int}; 1256 return {"0", Type::Int};
1257 } 1257 }
1258 1258
@@ -1332,7 +1332,7 @@ private:
1332 GetSwizzle(element)), 1332 GetSwizzle(element)),
1333 Type::Float}}; 1333 Type::Float}};
1334 } 1334 }
1335 UNIMPLEMENTED_MSG("Unhandled output attribute: {}", static_cast<u32>(attribute)); 1335 UNIMPLEMENTED_MSG("Unhandled output attribute: {}", attribute);
1336 return std::nullopt; 1336 return std::nullopt;
1337 } 1337 }
1338 } 1338 }
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index f19ef2173..daf352b50 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -689,8 +689,7 @@ void TextureCacheOpenGL::BufferCopy(Surface& src_surface, Surface& dst_surface)
689 dest_format.format, dest_format.type, nullptr); 689 dest_format.format, dest_format.type, nullptr);
690 break; 690 break;
691 default: 691 default:
692 LOG_CRITICAL(Render_OpenGL, "Unimplemented surface target={}", 692 LOG_CRITICAL(Render_OpenGL, "Unimplemented surface target={}", dst_params.target);
693 static_cast<u32>(dst_params.target));
694 UNREACHABLE(); 693 UNREACHABLE();
695 } 694 }
696 } 695 }
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h
index a8be2aa37..dd4ee3361 100644
--- a/src/video_core/renderer_opengl/maxwell_to_gl.h
+++ b/src/video_core/renderer_opengl/maxwell_to_gl.h
@@ -107,7 +107,7 @@ inline GLenum IndexFormat(Maxwell::IndexFormat index_format) {
107 case Maxwell::IndexFormat::UnsignedInt: 107 case Maxwell::IndexFormat::UnsignedInt:
108 return GL_UNSIGNED_INT; 108 return GL_UNSIGNED_INT;
109 } 109 }
110 UNREACHABLE_MSG("Invalid index_format={}", static_cast<u32>(index_format)); 110 UNREACHABLE_MSG("Invalid index_format={}", index_format);
111 return {}; 111 return {};
112} 112}
113 113
@@ -144,7 +144,7 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
144 case Maxwell::PrimitiveTopology::Patches: 144 case Maxwell::PrimitiveTopology::Patches:
145 return GL_PATCHES; 145 return GL_PATCHES;
146 } 146 }
147 UNREACHABLE_MSG("Invalid topology={}", static_cast<int>(topology)); 147 UNREACHABLE_MSG("Invalid topology={}", topology);
148 return GL_POINTS; 148 return GL_POINTS;
149} 149}
150 150
@@ -172,8 +172,8 @@ inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode,
172 } 172 }
173 break; 173 break;
174 } 174 }
175 UNREACHABLE_MSG("Invalid texture filter mode={} and mipmap filter mode={}", 175 UNREACHABLE_MSG("Invalid texture filter mode={} and mipmap filter mode={}", filter_mode,
176 static_cast<u32>(filter_mode), static_cast<u32>(mipmap_filter_mode)); 176 mipmap_filter_mode);
177 return GL_NEAREST; 177 return GL_NEAREST;
178} 178}
179 179
@@ -204,7 +204,7 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
204 return GL_MIRROR_CLAMP_TO_EDGE; 204 return GL_MIRROR_CLAMP_TO_EDGE;
205 } 205 }
206 } 206 }
207 UNIMPLEMENTED_MSG("Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode)); 207 UNIMPLEMENTED_MSG("Unimplemented texture wrap mode={}", wrap_mode);
208 return GL_REPEAT; 208 return GL_REPEAT;
209} 209}
210 210
@@ -227,7 +227,7 @@ inline GLenum DepthCompareFunc(Tegra::Texture::DepthCompareFunc func) {
227 case Tegra::Texture::DepthCompareFunc::Always: 227 case Tegra::Texture::DepthCompareFunc::Always:
228 return GL_ALWAYS; 228 return GL_ALWAYS;
229 } 229 }
230 UNIMPLEMENTED_MSG("Unimplemented texture depth compare function={}", static_cast<u32>(func)); 230 UNIMPLEMENTED_MSG("Unimplemented texture depth compare function={}", func);
231 return GL_GREATER; 231 return GL_GREATER;
232} 232}
233 233
@@ -249,7 +249,7 @@ inline GLenum BlendEquation(Maxwell::Blend::Equation equation) {
249 case Maxwell::Blend::Equation::MaxGL: 249 case Maxwell::Blend::Equation::MaxGL:
250 return GL_MAX; 250 return GL_MAX;
251 } 251 }
252 UNIMPLEMENTED_MSG("Unimplemented blend equation={}", static_cast<u32>(equation)); 252 UNIMPLEMENTED_MSG("Unimplemented blend equation={}", equation);
253 return GL_FUNC_ADD; 253 return GL_FUNC_ADD;
254} 254}
255 255
@@ -313,7 +313,7 @@ inline GLenum BlendFunc(Maxwell::Blend::Factor factor) {
313 case Maxwell::Blend::Factor::OneMinusConstantAlphaGL: 313 case Maxwell::Blend::Factor::OneMinusConstantAlphaGL:
314 return GL_ONE_MINUS_CONSTANT_ALPHA; 314 return GL_ONE_MINUS_CONSTANT_ALPHA;
315 } 315 }
316 UNIMPLEMENTED_MSG("Unimplemented blend factor={}", static_cast<u32>(factor)); 316 UNIMPLEMENTED_MSG("Unimplemented blend factor={}", factor);
317 return GL_ZERO; 317 return GL_ZERO;
318} 318}
319 319
@@ -333,7 +333,7 @@ inline GLenum SwizzleSource(Tegra::Texture::SwizzleSource source) {
333 case Tegra::Texture::SwizzleSource::OneFloat: 333 case Tegra::Texture::SwizzleSource::OneFloat:
334 return GL_ONE; 334 return GL_ONE;
335 } 335 }
336 UNIMPLEMENTED_MSG("Unimplemented swizzle source={}", static_cast<u32>(source)); 336 UNIMPLEMENTED_MSG("Unimplemented swizzle source={}", source);
337 return GL_ZERO; 337 return GL_ZERO;
338} 338}
339 339
@@ -364,7 +364,7 @@ inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) {
364 case Maxwell::ComparisonOp::AlwaysOld: 364 case Maxwell::ComparisonOp::AlwaysOld:
365 return GL_ALWAYS; 365 return GL_ALWAYS;
366 } 366 }
367 UNIMPLEMENTED_MSG("Unimplemented comparison op={}", static_cast<u32>(comparison)); 367 UNIMPLEMENTED_MSG("Unimplemented comparison op={}", comparison);
368 return GL_ALWAYS; 368 return GL_ALWAYS;
369} 369}
370 370
@@ -395,7 +395,7 @@ inline GLenum StencilOp(Maxwell::StencilOp stencil) {
395 case Maxwell::StencilOp::DecrWrapOGL: 395 case Maxwell::StencilOp::DecrWrapOGL:
396 return GL_DECR_WRAP; 396 return GL_DECR_WRAP;
397 } 397 }
398 UNIMPLEMENTED_MSG("Unimplemented stencil op={}", static_cast<u32>(stencil)); 398 UNIMPLEMENTED_MSG("Unimplemented stencil op={}", stencil);
399 return GL_KEEP; 399 return GL_KEEP;
400} 400}
401 401
@@ -406,7 +406,7 @@ inline GLenum FrontFace(Maxwell::FrontFace front_face) {
406 case Maxwell::FrontFace::CounterClockWise: 406 case Maxwell::FrontFace::CounterClockWise:
407 return GL_CCW; 407 return GL_CCW;
408 } 408 }
409 UNIMPLEMENTED_MSG("Unimplemented front face cull={}", static_cast<u32>(front_face)); 409 UNIMPLEMENTED_MSG("Unimplemented front face cull={}", front_face);
410 return GL_CCW; 410 return GL_CCW;
411} 411}
412 412
@@ -419,7 +419,7 @@ inline GLenum CullFace(Maxwell::CullFace cull_face) {
419 case Maxwell::CullFace::FrontAndBack: 419 case Maxwell::CullFace::FrontAndBack:
420 return GL_FRONT_AND_BACK; 420 return GL_FRONT_AND_BACK;
421 } 421 }
422 UNIMPLEMENTED_MSG("Unimplemented cull face={}", static_cast<u32>(cull_face)); 422 UNIMPLEMENTED_MSG("Unimplemented cull face={}", cull_face);
423 return GL_BACK; 423 return GL_BACK;
424} 424}
425 425
@@ -458,7 +458,7 @@ inline GLenum LogicOp(Maxwell::LogicOperation operation) {
458 case Maxwell::LogicOperation::Set: 458 case Maxwell::LogicOperation::Set:
459 return GL_SET; 459 return GL_SET;
460 } 460 }
461 UNIMPLEMENTED_MSG("Unimplemented logic operation={}", static_cast<u32>(operation)); 461 UNIMPLEMENTED_MSG("Unimplemented logic operation={}", operation);
462 return GL_COPY; 462 return GL_COPY;
463} 463}
464 464
@@ -471,7 +471,7 @@ inline GLenum PolygonMode(Maxwell::PolygonMode polygon_mode) {
471 case Maxwell::PolygonMode::Fill: 471 case Maxwell::PolygonMode::Fill:
472 return GL_FILL; 472 return GL_FILL;
473 } 473 }
474 UNREACHABLE_MSG("Invalid polygon mode={}", static_cast<int>(polygon_mode)); 474 UNREACHABLE_MSG("Invalid polygon mode={}", polygon_mode);
475 return GL_FILL; 475 return GL_FILL;
476} 476}
477 477
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 521b03ba2..cbfaaa99c 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -348,7 +348,7 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
348 } else { 348 } else {
349 // Other transformations are unsupported 349 // Other transformations are unsupported
350 LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}", 350 LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
351 static_cast<u32>(framebuffer_transform_flags)); 351 framebuffer_transform_flags);
352 UNIMPLEMENTED(); 352 UNIMPLEMENTED();
353 } 353 }
354 } 354 }