summary refs log tree commit diff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/shader.frag7
-rw-r--r--shaders/shader.vert5
2 files changed, 9 insertions, 3 deletions
diff --git a/shaders/shader.frag b/shaders/shader.frag
index a2561d1..90d6ab0 100644
--- a/shaders/shader.frag
+++ b/shaders/shader.frag
@@ -1,7 +1,10 @@
 #version 460
 
-layout(binding = 1) uniform sampler textureSampler;
-layout(binding = 2) uniform texture2D textureImage;
+//   Set 0 is the default, so we could omit it, but we prefer to be explicit.
+// It specifies which the descriptor set layout the binding index pertains to;
+// see init_pipeline() in render.rs.
+layout(set = 0, binding = 1) uniform sampler textureSampler;
+layout(set = 1, binding = 0) uniform texture2D textureImage;
 
 layout(location = 0) in vec3 fragmentColor;
 layout(location = 1) in vec2 fragmentTextureCoordinate;
diff --git a/shaders/shader.vert b/shaders/shader.vert
index 009b38f..bd8cd94 100644
--- a/shaders/shader.vert
+++ b/shaders/shader.vert
@@ -5,7 +5,10 @@ struct Transformation {
   vec3 translation;
 };
 
-layout(binding = 0) uniform UniformBlock {
+//   Set 0 is the default, so we could omit it, but we prefer to be explicit.
+// It specifies which the descriptor set layout the binding index pertains to;
+// see init_pipeline() in render.rs.
+layout(set = 0, binding = 0) uniform UniformBlock {
   Transformation view;
   mat4 projection;
 } uniform_block;