16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 00:49:19 +02:00

ubo padding fixes

This commit is contained in:
milek7
2020-10-21 17:59:27 +02:00
parent 494f4fbef2
commit 1c40578d26
3 changed files with 10 additions and 10 deletions

View File

@@ -71,7 +71,7 @@ void gl::glsl_common_setup()
mat4 projection;
mat4 inv_view;
mat4 lightview[MAX_CASCADES];
vec4 cascade_end;
vec3 cascade_end;
float time;
};

View File

@@ -43,11 +43,11 @@ namespace gl
glm::mat4 projection;
glm::mat4 inv_view;
glm::mat4 lightview[MAX_CASCADES];
glm::vec4 cascade_end;
glm::vec3 cascade_end;
float time;
};
static_assert(sizeof(scene_ubs) == 340, "bad size of ubs");
static_assert(sizeof(scene_ubs) == 336, "bad size of ubs");
const size_t MAX_PARAMS = 3;
@@ -63,7 +63,7 @@ namespace gl
float fog_density;
float alpha_mult;
float shadow_tone;
UBS_PAD(4);
UBS_PAD(12);
void set_modelview(const glm::mat4 &mv)
{
@@ -72,7 +72,7 @@ namespace gl
}
};
static_assert(sizeof(model_ubs) == 200 + 16 * MAX_PARAMS, "bad size of ubs");
static_assert(sizeof(model_ubs) == 208 + 16 * MAX_PARAMS, "bad size of ubs");
struct light_element_ubs
{