summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2018-09-25 19:41:21 -0300
committerGravatar ReinUsesLisp2018-09-25 21:07:00 -0300
commitab65fde9f489ca32aa7bd3a7e7bcd1f92a61c0d1 (patch)
treeae8fd84ba5c5c3beeed1b9e3f6c4ff425f1a3d46 /src/video_core/renderer_opengl
parentMerge pull request #1365 from DarkLordZach/lfs (diff)
downloadyuzu-ab65fde9f489ca32aa7bd3a7e7bcd1f92a61c0d1.tar.gz
yuzu-ab65fde9f489ca32aa7bd3a7e7bcd1f92a61c0d1.tar.xz
yuzu-ab65fde9f489ca32aa7bd3a7e7bcd1f92a61c0d1.zip
video_core: Add asserts for CS, TFB and alpha testing
Add asserts for compute shader dispatching, transform feedback being enabled and alpha testing. These have in common that they'll probably break rendering without logging.
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp22
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 70fb54507..44850d193 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -450,6 +450,8 @@ void RasterizerOpenGL::DrawArrays() {
450 SyncBlendState(); 450 SyncBlendState();
451 SyncLogicOpState(); 451 SyncLogicOpState();
452 SyncCullMode(); 452 SyncCullMode();
453 SyncAlphaTest();
454 SyncTransformFeedback();
453 455
454 // TODO(bunnei): Sync framebuffer_scale uniform here 456 // TODO(bunnei): Sync framebuffer_scale uniform here
455 // TODO(bunnei): Sync scissorbox uniform(s) here 457 // TODO(bunnei): Sync scissorbox uniform(s) here
@@ -883,4 +885,24 @@ void RasterizerOpenGL::SyncLogicOpState() {
883 state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation); 885 state.logic_op.operation = MaxwellToGL::LogicOp(regs.logic_op.operation);
884} 886}
885 887
888void RasterizerOpenGL::SyncAlphaTest() {
889 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
890
891 // TODO(Rodrigo): Alpha testing is a legacy OpenGL feature, but it can be
892 // implemented with a test+discard in fragment shaders.
893 if (regs.alpha_test_enabled != 0) {
894 LOG_CRITICAL(Render_OpenGL, "Alpha testing is not implemented");
895 UNREACHABLE();
896 }
897}
898
899void RasterizerOpenGL::SyncTransformFeedback() {
900 const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
901
902 if (regs.tfb_enabled != 0) {
903 LOG_CRITICAL(Render_OpenGL, "Transform feedbacks are not implemented");
904 UNREACHABLE();
905 }
906}
907
886} // namespace OpenGL 908} // namespace OpenGL
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index bf9560bdc..c3f1e14bf 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -158,6 +158,12 @@ private:
158 /// Syncs the LogicOp state to match the guest state 158 /// Syncs the LogicOp state to match the guest state
159 void SyncLogicOpState(); 159 void SyncLogicOpState();
160 160
161 /// Syncs the alpha test state to match the guest state
162 void SyncAlphaTest();
163
164 /// Syncs the transform feedback state to match the guest state
165 void SyncTransformFeedback();
166
161 bool has_ARB_direct_state_access = false; 167 bool has_ARB_direct_state_access = false;
162 bool has_ARB_multi_bind = false; 168 bool has_ARB_multi_bind = false;
163 bool has_ARB_separate_shader_objects = false; 169 bool has_ARB_separate_shader_objects = false;