mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 22:30:22 +00:00
f420c143e0
The idea here is that we can do more complex combinations and use that to support texture-scale nodes or use fancy texture formats (suc as YUV). I'm not sure this is actually necessary, but for now it gives more flexibility.
37 lines
1.2 KiB
GLSL
37 lines
1.2 KiB
GLSL
#version 420 core
|
|
|
|
#include "common.vert.glsl"
|
|
#include "rect.vert.glsl"
|
|
|
|
layout(location = 0) in vec4 inRect;
|
|
layout(location = 1) in vec4 inTopRect;
|
|
layout(location = 2) in vec4 inBottomRect;
|
|
layout(location = 3) in vec4 inTopTexRect;
|
|
layout(location = 4) in vec4 inBottomTexRect;
|
|
layout(location = 5) in uvec2 inTopTexId;
|
|
layout(location = 6) in uvec2 inBottomTexId;
|
|
layout(location = 7) in uint inBlendMode;
|
|
|
|
layout(location = 0) out vec2 outPos;
|
|
layout(location = 1) flat out Rect outTopRect;
|
|
layout(location = 2) flat out Rect outBottomRect;
|
|
layout(location = 3) out vec2 outTopTexCoord;
|
|
layout(location = 4) out vec2 outBottomTexCoord;
|
|
layout(location = 5) flat out uvec2 outTopTexId;
|
|
layout(location = 6) flat out uvec2 outBottomTexId;
|
|
layout(location = 7) flat out uint outBlendMode;
|
|
|
|
void main() {
|
|
Rect r = rect_from_gsk (inRect);
|
|
vec2 pos = set_position_from_rect (r);
|
|
|
|
outPos = pos;
|
|
outTopRect = rect_from_gsk (inTopRect);
|
|
outBottomRect = rect_from_gsk (inBottomRect);
|
|
outTopTexCoord = scale_tex_coord (pos, r, inTopTexRect);
|
|
outBottomTexCoord = scale_tex_coord (pos, r, inBottomTexRect);
|
|
outTopTexId = inTopTexId;
|
|
outBottomTexId = inBottomTexId;
|
|
outBlendMode = inBlendMode;
|
|
}
|