mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 21:40:19 +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/
19 lines
438 B
GLSL
19 lines
438 B
GLSL
#version 450
|
|
|
|
#include "common.frag.glsl"
|
|
#include "clip.frag.glsl"
|
|
#include "rect.frag.glsl"
|
|
|
|
layout(location = 0) in vec2 inPos;
|
|
layout(location = 1) in Rect inRect;
|
|
layout(location = 2) in vec2 inTexCoord;
|
|
layout(location = 3) flat in uint inTexId;
|
|
|
|
layout(location = 0) out vec4 color;
|
|
|
|
void main()
|
|
{
|
|
float alpha = rect_coverage (inRect, inPos);
|
|
color = clip_scaled (inPos, texture (get_sampler (inTexId), inTexCoord) * alpha);
|
|
}
|