diff options
Diffstat (limited to 'shaders/ui.frag')
| -rw-r--r-- | shaders/ui.frag | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/shaders/ui.frag b/shaders/ui.frag index 78833d1..c4e0150 100644 --- a/shaders/ui.frag +++ b/shaders/ui.frag @@ -1,3 +1,5 @@ +#extension GL_EXT_nonuniform_qualifier : require
+
layout(location = 0) out vec4 o_Color;
layout(location = 0) in struct {
@@ -5,8 +7,14 @@ layout(location = 0) in struct { vec4 color;
} In;
-layout(set = 0, binding = 2) uniform sampler2D atlas;
+layout(set = 0, binding = 0) uniform sampler samplers[];
+layout(set = 0, binding = 1) uniform texture2D textures[];
+
+layout(push_constant) uniform constants {
+ layout(offset = 56) uint texture_index;
+ uint sampler_index;
+} consts;
void main() {
- o_Color = In.color * texture(atlas, In.uv.xy);
+ o_Color = In.color * texture(sampler2D(textures[consts.texture_index], samplers[consts.sampler_index]), In.uv.xy);
}
|
