瀏覽代碼

LibGL: Ignore stack on projection and model view matrix retrieval

Our implementation keeps the top-most item on the matrix stacks in a
member variable, so we can always use that instead of considering the
actual stack.

Additionally, the current matrix mode should not influence retrieving
the projection or model view matrix.
Jelle Raaijmakers 3 年之前
父節點
當前提交
36a732e98e
共有 1 個文件被更改,包括 3 次插入12 次删除
  1. 3 12
      Userland/Libraries/LibGL/SoftwareGLContext.cpp

+ 3 - 12
Userland/Libraries/LibGL/SoftwareGLContext.cpp

@@ -1,6 +1,7 @@
 /*
 /*
  * Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
  * Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
  * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
+ * Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
  *
  *
  * SPDX-License-Identifier: BSD-2-Clause
  * SPDX-License-Identifier: BSD-2-Clause
  */
  */
@@ -1931,20 +1932,10 @@ void SoftwareGLContext::get_floating_point(GLenum pname, T* params)
     };
     };
     switch (pname) {
     switch (pname) {
     case GL_MODELVIEW_MATRIX:
     case GL_MODELVIEW_MATRIX:
-        if (m_current_matrix_mode == GL_MODELVIEW)
-            flatten_and_assign_matrix(m_model_view_matrix);
-        else if (m_model_view_matrix_stack.is_empty())
-            flatten_and_assign_matrix(FloatMatrix4x4::identity());
-        else
-            flatten_and_assign_matrix(m_model_view_matrix_stack.last());
+        flatten_and_assign_matrix(m_model_view_matrix);
         return;
         return;
     case GL_PROJECTION_MATRIX:
     case GL_PROJECTION_MATRIX:
-        if (m_current_matrix_mode == GL_PROJECTION)
-            flatten_and_assign_matrix(m_projection_matrix);
-        else if (m_projection_matrix_stack.is_empty())
-            flatten_and_assign_matrix(FloatMatrix4x4::identity());
-        else
-            flatten_and_assign_matrix(m_projection_matrix_stack.last());
+        flatten_and_assign_matrix(m_projection_matrix);
         return;
         return;
     }
     }