Drawable Renderer (#1570), Add renderable size uniform for fill layer

This commit is contained in:
Tim Sylvester
2023-05-22 16:55:05 -07:00
committed by Bart Louwers
parent 353d96b5bf
commit b5abc33c4b
7 changed files with 22 additions and 8 deletions

View File

@@ -174,6 +174,8 @@ private:
struct alignas(16) DrawableUBO {
std::array<float, 4 * 4> matrix;
std::array<float, 2> world;
std::array<float, 2> padding;
};
static_assert(sizeof(DrawableUBO) % 16 == 0);

View File

@@ -13,6 +13,8 @@ struct ShaderSource<BuiltIn::BackgroundShader, gfx::Backend::Type::OpenGL> {
static constexpr const char* vertex = R"(layout (location = 0) in vec2 a_pos;
layout (std140) uniform DrawableUBO {
mat4 u_matrix;
vec2 u_world;
vec2 pad;
};
void main() {

View File

@@ -14,6 +14,8 @@ struct ShaderSource<BuiltIn::FillShader, gfx::Backend::Type::OpenGL> {
layout (std140) uniform DrawableUBO {
mat4 u_matrix;
vec2 u_world;
vec2 pad;
};
#ifndef HAS_UNIFORM_u_color

View File

@@ -12,8 +12,11 @@ struct ShaderSource<BuiltIn::FillOutlineShader, gfx::Backend::Type::OpenGL> {
static constexpr const char* name = "FillOutlineShader";
static constexpr const char* vertex = R"(layout (location = 0) in vec2 a_pos;
uniform mat4 u_matrix;
uniform vec2 u_world;
layout (std140) uniform DrawableUBO {
mat4 u_matrix;
vec2 u_world;
vec2 pad;
};
out vec2 v_pos;