Module: Mesa
Branch: main
Commit: d941078129bad10f87cb93e4d2164904adc77cff
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d941078129bad10f87cb93e4d2164904adc77cff

Author: Erik Faye-Lund <[email protected]>
Date:   Mon Jun 26 15:38:30 2023 +0200

math: drop MAT_[ST][XYZ] defines

These were used a single time each, and that argually made the code a
bit more confusing to read. Let's just drop these, and use the correct
indexes directly.

Reviewed-by: Yonggang Luo <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24003>

---

 src/mesa/math/m_matrix.c | 12 ++++++------
 src/mesa/math/m_matrix.h | 14 --------------
 2 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index af058906312..da2b0aea24e 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -931,12 +931,12 @@ void
 _math_matrix_viewport(GLmatrix *m, const float scale[3],
                       const float translate[3], double depthMax)
 {
-   m->m[MAT_SX] = scale[0];
-   m->m[MAT_TX] = translate[0];
-   m->m[MAT_SY] = scale[1];
-   m->m[MAT_TY] = translate[1];
-   m->m[MAT_SZ] = depthMax*scale[2];
-   m->m[MAT_TZ] = depthMax*translate[2];
+   m->m[0] = scale[0];
+   m->m[5] = scale[1];
+   m->m[10] = depthMax*scale[2];
+   m->m[12] = translate[0];
+   m->m[13] = translate[1];
+   m->m[14] = depthMax*translate[2];
    m->flags = MAT_FLAG_GENERAL_SCALE | MAT_FLAG_TRANSLATION;
    m->type = MATRIX_3D_NO_ROT;
 }
diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h
index 7f072b3a9b7..da87c211d87 100644
--- a/src/mesa/math/m_matrix.h
+++ b/src/mesa/math/m_matrix.h
@@ -40,20 +40,6 @@ extern "C" {
 #endif
 
 
-/**
- * \name Symbolic names to some of the entries in the matrix
- *
- * These are handy for the viewport mapping, which is expressed as a matrix.
- */
-/*@{*/
-#define MAT_SX 0
-#define MAT_SY 5
-#define MAT_SZ 10
-#define MAT_TX 12
-#define MAT_TY 13
-#define MAT_TZ 14
-/*@}*/
-
 /**
  * Different kinds of 4x4 transformation matrices.
  * We use these to select specific optimized vertex transformation routines.

Reply via email to