Drawable Renderer (#1570), Add renderable size uniform for fill layer
This commit is contained in:
committed by
Bart Louwers
parent
353d96b5bf
commit
b5abc33c4b
@@ -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);
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user