summaryrefslogtreecommitdiff
path: root/include/render/fx_renderer/shaders.h
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2023-12-31 00:32:39 +0100
committerErik Reider <[email protected]>2024-01-03 23:49:04 +0100
commit51c7078b9ec413ebd8316501f01ccf769a090f64 (patch)
treec66ea9c9e7dd010c069acf1578dd617d23a1d0cc /include/render/fx_renderer/shaders.h
parentb6a990da71b5b0947650a50dcf1a083acfce868c (diff)
Converted fx_renderer to impl wlr_renderer
Makes the fx_renderer the default renderer for everything, no wlr_gles2 rendering. This includes wlr_render_pass (fx_render_pass in our case)
Diffstat (limited to 'include/render/fx_renderer/shaders.h')
-rw-r--r--include/render/fx_renderer/shaders.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/include/render/fx_renderer/shaders.h b/include/render/fx_renderer/shaders.h
new file mode 100644
index 0000000..584b18e
--- /dev/null
+++ b/include/render/fx_renderer/shaders.h
@@ -0,0 +1,69 @@
+#ifndef _FX_SHADERS_H
+#define _FX_SHADERS_H
+
+#include <GLES2/gl2.h>
+#include <stdbool.h>
+
+struct fx_renderer;
+
+GLuint compile_shader(GLuint type, const GLchar *src);
+
+GLuint link_program(const GLchar *frag_src);
+
+bool check_gl_ext(const char *exts, const char *ext);
+
+void load_gl_proc(void *proc_ptr, const char *name);
+
+enum fx_tex_shader_source {
+ SHADER_SOURCE_TEXTURE_RGBA = 1,
+ SHADER_SOURCE_TEXTURE_RGBX = 2,
+ SHADER_SOURCE_TEXTURE_EXTERNAL = 3,
+};
+
+struct quad_shader {
+ GLuint program;
+ GLint proj;
+ GLint color;
+ GLint pos_attrib;
+};
+
+struct tex_shader {
+ GLuint program;
+ GLint proj;
+ GLint tex_proj;
+ GLint tex;
+ GLint alpha;
+ GLint pos_attrib;
+ GLint size;
+ GLint position;
+ GLint radius;
+};
+
+struct stencil_mask_shader {
+ GLuint program;
+ GLint proj;
+ GLint tex_proj;
+ GLint tex;
+ GLint pos_attrib;
+ GLint half_size;
+ GLint position;
+ GLint color;
+ GLint radius;
+};
+
+struct box_shadow_shader {
+ GLuint program;
+ GLint proj;
+ GLint tex_proj;
+ GLint tex;
+ GLint pos_attrib;
+ GLint position;
+ GLint size;
+ GLint color;
+ GLint blur_sigma;
+ GLint corner_radius;
+};
+
+bool link_shaders(struct fx_renderer *renderer);
+
+#endif