summary refs log tree commit diff
path: root/shaders
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-08-12 19:13:32 -0700
committerIrene Knapp <ireneista@irenes.space>2026-08-12 19:13:32 -0700
commit19e3a0f319fd04c1dde803796ec272d038b634f7 (patch)
tree502077d3e1dab810f037faea810f1cfd2c5ec691 /shaders
parent87f60b880bd1ce586972f9b70dd6c627b1df92cd (diff)
split the texture's sampler and its image view into separaet bindings HEAD main
this will make it easier to change the image view dynamically as a push update, in a future CL

Force-Push: yes
Change-Id: If7cfab07913a5a462e16dd7fb478ed491d33d4d9
Diffstat (limited to 'shaders')
-rw-r--r--shaders/shader.frag5
1 files changed, 3 insertions, 2 deletions
diff --git a/shaders/shader.frag b/shaders/shader.frag
index 20550ba..a2561d1 100644
--- a/shaders/shader.frag
+++ b/shaders/shader.frag
@@ -1,6 +1,7 @@
 #version 460
 
-layout(binding = 1) uniform sampler2D textureSampler;
+layout(binding = 1) uniform sampler textureSampler;
+layout(binding = 2) uniform texture2D textureImage;
 
 layout(location = 0) in vec3 fragmentColor;
 layout(location = 1) in vec2 fragmentTextureCoordinate;
@@ -9,7 +10,7 @@ layout(location = 0) out vec4 outColor;
 
 void main() {
   outColor = vec4(fragmentColor
-                      * texture(textureSampler,
+                      * texture(sampler2D(textureImage, textureSampler),
                                 fragmentTextureCoordinate).rgb,
                   1.0);
 }