diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-08-09 22:41:03 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-08-09 22:41:03 +0200 |
| commit | 8c1e26e552556e36a5c1fecd9558d9ab9dd3d454 (patch) | |
| tree | 554af62f3bd3fb237c07de55dfad1da7dac30592 /shaders/ui.frag | |
| parent | 03fdcb0341d35bb99fccb2e155ee967f932c9961 (diff) | |
Bindless graphics pipeline
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);
}
|
