mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
render/vulkan: use array declaration in encode_proj_matrix()
This makes it more obvious what the final layout of the matrix will be.
This commit is contained in:
parent
1df2274f6c
commit
a5706e2fb9
1 changed files with 7 additions and 10 deletions
|
|
@ -68,17 +68,14 @@ static float color_to_linear_premult(float non_linear, float alpha) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void encode_proj_matrix(const float mat3[9], float mat4[4][4]) {
|
static void encode_proj_matrix(const float mat3[9], float mat4[4][4]) {
|
||||||
memset(mat4, 0, sizeof(float) * 16);
|
float result[4][4] = {
|
||||||
mat4[0][0] = mat3[0];
|
{ mat3[0], mat3[1], 0, mat3[2] },
|
||||||
mat4[0][1] = mat3[1];
|
{ mat3[3], mat3[4], 0, mat3[5] },
|
||||||
mat4[0][3] = mat3[2];
|
{ 0, 0, 1, 0 },
|
||||||
|
{ 0, 0, 0, 1 },
|
||||||
|
};
|
||||||
|
|
||||||
mat4[1][0] = mat3[3];
|
memcpy(mat4, result, sizeof(result));
|
||||||
mat4[1][1] = mat3[4];
|
|
||||||
mat4[1][3] = mat3[5];
|
|
||||||
|
|
||||||
mat4[2][2] = 1.f;
|
|
||||||
mat4[3][3] = 1.f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void render_pass_destroy(struct wlr_vk_render_pass *pass) {
|
static void render_pass_destroy(struct wlr_vk_render_pass *pass) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue