mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
render/gles2: transpose matrices before binding them
Setting glUniformMatrix3fv's transpose parameter to GL_TRUE is not allowed for OpenGL ES 2. This adds a wlr_matrix_transpose function.
This commit is contained in:
parent
6227da96b1
commit
6ecb0eefcb
3 changed files with 30 additions and 5 deletions
|
|
@ -33,6 +33,15 @@ void wlr_matrix_multiply(float mat[static 9], const float a[static 9],
|
|||
memcpy(mat, product, sizeof(product));
|
||||
}
|
||||
|
||||
void wlr_matrix_transpose(float mat[static 9], const float a[static 9]) {
|
||||
float transposition[9] = {
|
||||
a[0], a[3], a[6],
|
||||
a[1], a[4], a[7],
|
||||
a[2], a[5], a[8],
|
||||
};
|
||||
memcpy(mat, transposition, sizeof(transposition));
|
||||
}
|
||||
|
||||
void wlr_matrix_translate(float mat[static 9], float x, float y) {
|
||||
float translate[9] = {
|
||||
1.0f, 0.0f, x,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue