diff options
| author | dec05eba <dec05eba@protonmail.com> | 2025-09-21 03:20:58 +0200 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2025-09-21 03:21:30 +0200 |
| commit | 1ded0a79fd9519d4155ee06685df193c7c80d79f (patch) | |
| tree | 51b2130450dc64c5c220adf2e1326fc691118f19 /include | |
| parent | 2c22782ca0af78070089938feb873beaa1d78722 (diff) | |
Remove compute shader. It doesn't improve performance and it has worse UV quality because of incorrect pixel colors
Diffstat (limited to 'include')
| -rw-r--r-- | include/color_conversion.h | 17 | ||||
| -rw-r--r-- | include/egl.h | 5 | ||||
| -rw-r--r-- | include/shader.h | 2 |
3 files changed, 2 insertions, 22 deletions
diff --git a/include/color_conversion.h b/include/color_conversion.h index e6eece6..c43238a 100644 --- a/include/color_conversion.h +++ b/include/color_conversion.h @@ -6,7 +6,6 @@ #include "vec2.h" #include <stdbool.h> -#define GSR_COLOR_CONVERSION_MAX_COMPUTE_SHADERS 12 #define GSR_COLOR_CONVERSION_MAX_GRAPHICS_SHADERS 6 #define GSR_COLOR_CONVERSION_MAX_FRAMEBUFFERS 2 @@ -34,13 +33,6 @@ typedef struct { } gsr_color_graphics_uniforms; typedef struct { - int rotation_matrix; - int source_position; - int target_position; - int scale; -} gsr_color_compute_uniforms; - -typedef struct { gsr_egl *egl; gsr_destination_color destination_color; @@ -51,27 +43,18 @@ typedef struct { gsr_color_range color_range; bool load_external_image_shader; - bool force_graphics_shader; } gsr_color_conversion_params; typedef struct { gsr_color_conversion_params params; - gsr_color_compute_uniforms compute_uniforms[GSR_COLOR_CONVERSION_MAX_COMPUTE_SHADERS]; - gsr_shader compute_shaders[GSR_COLOR_CONVERSION_MAX_COMPUTE_SHADERS]; - /* These are only loader if compute shaders (of the same type) fail to load */ gsr_color_graphics_uniforms graphics_uniforms[GSR_COLOR_CONVERSION_MAX_GRAPHICS_SHADERS]; gsr_shader graphics_shaders[GSR_COLOR_CONVERSION_MAX_GRAPHICS_SHADERS]; - bool compute_shaders_failed_to_load; - bool external_compute_shaders_failed_to_load; - unsigned int framebuffers[GSR_COLOR_CONVERSION_MAX_FRAMEBUFFERS]; unsigned int vertex_array_object_id; unsigned int vertex_buffer_object_id; - - int max_local_size_dim; } gsr_color_conversion; int gsr_color_conversion_init(gsr_color_conversion *self, const gsr_color_conversion_params *params); diff --git a/include/egl.h b/include/egl.h index fb67768..d895658 100644 --- a/include/egl.h +++ b/include/egl.h @@ -136,7 +136,6 @@ typedef void(*__GLXextFuncPtr)(void); #define GL_READ_ONLY 0x88B8 #define GL_WRITE_ONLY 0x88B9 #define GL_READ_WRITE 0x88BA -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS 0x90EB #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 @@ -150,7 +149,6 @@ typedef void(*__GLXextFuncPtr)(void); #define GL_INFO_LOG_LENGTH 0x8B84 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 -#define GL_COMPUTE_SHADER 0x91B9 #define GL_COMPILE_STATUS 0x8B81 #define GL_LINK_STATUS 0x8B82 @@ -258,7 +256,6 @@ struct gsr_egl { void (*glTexParameteri)(unsigned int target, unsigned int pname, int param); void (*glTexParameteriv)(unsigned int target, unsigned int pname, const int *params); void (*glTexParameterfv)(unsigned int target, unsigned int pname, const float *params); - void (*glGetTexLevelParameteriv)(unsigned int target, int level, unsigned int pname, int *params); void (*glTexImage2D)(unsigned int target, int level, int internalFormat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels); void (*glTexSubImage2D)(unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, const void *pixels); void (*glTexStorage2D)(unsigned int target, int levels, unsigned int internalformat, int width, int height); @@ -266,7 +263,7 @@ struct gsr_egl { void (*glGenFramebuffers)(int n, unsigned int *framebuffers); void (*glBindFramebuffer)(unsigned int target, unsigned int framebuffer); void (*glDeleteFramebuffers)(int n, const unsigned int *framebuffers); - void (*glDispatchCompute)(unsigned int num_groups_x, unsigned int num_groups_y, unsigned int num_groups_z); + /* TODO: Note: this is only available since OpenGL ES 3.1 */ void (*glMemoryBarrier)(unsigned int barriers); void (*glViewport)(int x, int y, int width, int height); void (*glFramebufferTexture2D)(unsigned int target, unsigned int attachment, unsigned int textarget, unsigned int texture, int level); diff --git a/include/shader.h b/include/shader.h index 285758d..2fd2603 100644 --- a/include/shader.h +++ b/include/shader.h @@ -11,7 +11,7 @@ typedef struct { } gsr_shader; /* |vertex_shader| or |fragment_shader| may be NULL */ -int gsr_shader_init(gsr_shader *self, gsr_egl *egl, const char *vertex_shader, const char *fragment_shader, const char *compute_shader); +int gsr_shader_init(gsr_shader *self, gsr_egl *egl, const char *vertex_shader, const char *fragment_shader); void gsr_shader_deinit(gsr_shader *self); int gsr_shader_bind_attribute_location(gsr_shader *self, const char *attribute, int location); |
