mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 22:30:22 +00:00
d665d2fb89
The magical term to know about (because the GLSL compiler or the validation layers sure as hell don't) is: "dynamically uniform expression" because if you don't have that when indexing a texture or buffer array, you need to add nonuniformEXT() around the index variable. Fixes the close icon on AMD having glitches of the previous icon visible in some pixels.
12 lines
378 B
GLSL
12 lines
378 B
GLSL
#extension GL_EXT_nonuniform_qualifier : enable
|
|
|
|
layout(set = 0, binding = 0) uniform sampler2D textures[50000];
|
|
layout(set = 1, binding = 0) readonly buffer FloatBuffers {
|
|
float floats[];
|
|
} buffers[50000];
|
|
|
|
#define get_sampler(id) textures[nonuniformEXT (id)]
|
|
#define get_buffer(id) buffers[nonuniformEXT (id)]
|
|
#define get_float(id) get_buffer(0).floats[nonuniformEXT (id)]
|
|
|