Switch shader texture usage from sampler2D to texture2D plus sampler (fixes #1)

This commit is contained in:
Keavon Chambers
2020-07-11 19:01:48 -07:00
parent 58992ba8ad
commit 642c7ffd00
8 changed files with 70 additions and 6 deletions
+4 -2
View File
@@ -16,8 +16,10 @@ layout(set=0, binding=0) uniform GuiNodeUniform {
vec4 border_color;
vec4 fill_color;
};
layout(set=0, binding=1) uniform sampler2D t_texture;
layout(set=0, binding=1) uniform texture2D t_texture;
layout(set=0, binding=2) uniform sampler s_texture;
void main() {
f_color = fill_color * texture(t_texture, v_uv / textureSize(t_texture, 0) * 100);
f_color = fill_color * texture(sampler2D(t_texture, s_texture), v_uv / textureSize(sampler2D(t_texture, s_texture), 0) * 500);
}
+1 -1
View File
@@ -5,6 +5,6 @@ layout(location=0) in vec2 a_position;
layout(location=0) out vec2 v_uv;
void main() {
v_uv = a_position;
v_uv = (a_position + 1) / 2;
gl_Position = vec4(a_position, 0.0, 1.0);
}