mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
8207c548cc
This reverts most of commit f420c143e0
again because it turns out GPUs like combined images and samplers.
But: The one thing we don't revert is allowing the C code to select any
combination of sampler and image:
gsk_vulkan_render_get_image_descriptor() now takes a 2nd argument
specifying the sampler.
This allows the same flexibility as before, we just combine things
early.
This change was inspired by
https://developer.nvidia.com/blog/vulkan-dos-donts/
24 lines
555 B
GLSL
24 lines
555 B
GLSL
#version 450
|
|
|
|
#include "common.vert.glsl"
|
|
#include "rect.vert.glsl"
|
|
|
|
layout(location = 0) in vec4 inRect;
|
|
layout(location = 1) in vec4 inTexRect;
|
|
layout(location = 2) in uint inTexId;
|
|
|
|
layout(location = 0) out vec2 outPos;
|
|
layout(location = 1) out flat Rect outRect;
|
|
layout(location = 2) out vec2 outTexCoord;
|
|
layout(location = 3) out flat uint outTexId;
|
|
|
|
void main() {
|
|
Rect r = rect_from_gsk (inRect);
|
|
vec2 pos = set_position_from_rect (r);
|
|
|
|
outPos = pos;
|
|
outRect = r;
|
|
outTexCoord = scale_tex_coord (pos, r, inTexRect);
|
|
outTexId = inTexId;
|
|
}
|