Commit: dcf90db4c39ad0b3164b50b46dff5a44db85576a
Parent: ba6c29c8d28fe4e5d7dc216915828e71f0e39e58
Author: Randy Palamar
Date: Tue, 22 Oct 2024 17:12:41 -0600
drop useless fragment_pixel_coordinate variable
programming too many compute shaders; i forgor gl_FragCoord
Diffstat:
4 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/frag_for_rects.glsl b/frag_for_rects.glsl
@@ -1,8 +1,7 @@
#version 430 core
-layout(location = 0) in vec2 fragment_pixel_coordinate;
-layout(location = 1) in vec2 fragment_texture_coordinate;
-layout(location = 2) in vec4 fragment_colour;
+layout(location = 0) in vec2 fragment_texture_coordinate;
+layout(location = 1) in vec4 fragment_colour;
layout(location = 0) out vec4 colour;
diff --git a/frag_post.glsl b/frag_post.glsl
@@ -1,8 +1,7 @@
#version 430 core
-layout(location = 0) in vec2 fragment_pixel_coordinate;
-layout(location = 1) in vec2 fragment_texture_coordinate;
-layout(location = 2) in vec4 fragment_colour;
+layout(location = 0) in vec2 fragment_texture_coordinate;
+layout(location = 1) in vec4 fragment_colour;
layout(location = 0) out vec4 colour;
diff --git a/frag_render.glsl b/frag_render.glsl
@@ -1,8 +1,7 @@
#version 430 core
-layout(location = 0) in vec2 fragment_pixel_coordinate;
-layout(location = 1) in vec2 fragment_texture_coordinate;
-layout(location = 2) in vec4 fragment_colour;
+layout(location = 0) in vec2 fragment_texture_coordinate;
+layout(location = 1) in vec4 fragment_colour;
layout(location = 0) out vec4 colour;
@@ -52,7 +51,7 @@ unpack_glyph_position(uint glyph_position)
void main()
{
- vec2 pixel_coord = fragment_pixel_coordinate - top_left_margin;
+ vec2 pixel_coord = gl_FragCoord.xy - top_left_margin;
uvec2 cell_index = uvec2(pixel_coord / cell_size);
vec2 cell_pos = mod(pixel_coord, cell_size);
diff --git a/vert_for_rects.glsl b/vert_for_rects.glsl
@@ -4,17 +4,14 @@ layout(location = 0) in vec2 vertex_position;
layout(location = 1) in vec2 vertex_texture_coordinate;
layout(location = 2) in vec4 vertex_colour;
-layout(location = 0) out vec2 fragment_pixel_coordinate;
-layout(location = 1) out vec2 fragment_texture_coordinate;
-layout(location = 2) out vec4 fragment_colour;
-layout(location = 3) out flat int fragment_texture_index;
+layout(location = 0) out vec2 fragment_texture_coordinate;
+layout(location = 1) out vec4 fragment_colour;
layout(location = 0) uniform mat4 u_Pmat;
void main()
{
fragment_texture_coordinate = vertex_texture_coordinate;
- fragment_pixel_coordinate = vertex_position * vertex_texture_coordinate;
fragment_colour = vertex_colour;
gl_Position = u_Pmat * vec4(vertex_position, 0.0, 1.0);