summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorWill McKinnon <[email protected]>2023-04-30 13:03:09 -0400
committerWill McKinnon <[email protected]>2023-04-30 13:35:01 -0400
commitace9a222b8557aa93ba2b6f3dac27424131574e4 (patch)
tree2bd1817b20b118f07d6587d6d81ba89ebef992ff /include
parent06339c325c512a71a4344f4a05ddbc2f3dd162fb (diff)
style: created struct for each shader type
Diffstat (limited to 'include')
-rw-r--r--include/sway/desktop/fx_renderer/fx_renderer.h120
1 files changed, 60 insertions, 60 deletions
diff --git a/include/sway/desktop/fx_renderer/fx_renderer.h b/include/sway/desktop/fx_renderer/fx_renderer.h
index 2aa38a7f..bdbcefe1 100644
--- a/include/sway/desktop/fx_renderer/fx_renderer.h
+++ b/include/sway/desktop/fx_renderer/fx_renderer.h
@@ -35,20 +35,47 @@ struct decoration_data {
bool blur;
};
-struct gles2_tex_shader {
+struct blur_shader {
GLuint program;
GLint proj;
GLint tex;
- GLint alpha;
GLint pos_attrib;
GLint tex_attrib;
+ GLint radius;
+ GLint halfpixel;
+};
+
+struct box_shadow_shader {
+ GLuint program;
+ GLint proj;
+ GLint color;
+ GLint pos_attrib;
+ GLint position;
GLint size;
+ GLint blur_sigma;
+ GLint corner_radius;
+};
+
+struct corner_shader {
+ GLuint program;
+ GLint proj;
+ GLint color;
+ GLint pos_attrib;
+ GLint is_top_left;
+ GLint is_top_right;
+ GLint is_bottom_left;
+ GLint is_bottom_right;
GLint position;
GLint radius;
- GLint saturation;
- GLint dim;
- GLint dim_color;
- GLint has_titlebar;
+ GLint half_size;
+ GLint half_thickness;
+};
+
+struct quad_shader {
+ GLuint program;
+ GLint proj;
+ GLint color;
+ GLint pos_attrib;
};
struct rounded_quad_shader {
@@ -61,14 +88,30 @@ struct rounded_quad_shader {
GLint radius;
};
-struct blur_shader {
+struct stencil_mask_shader {
+ GLuint program;
+ GLint proj;
+ GLint color;
+ GLint pos_attrib;
+ GLint half_size;
+ GLint position;
+ GLint radius;
+};
+
+struct tex_shader {
GLuint program;
GLint proj;
GLint tex;
+ GLint alpha;
GLint pos_attrib;
GLint tex_attrib;
+ GLint size;
+ GLint position;
GLint radius;
- GLint halfpixel;
+ GLint saturation;
+ GLint dim;
+ GLint dim_color;
+ GLint has_titlebar;
};
struct fx_renderer {
@@ -95,64 +138,21 @@ struct fx_renderer {
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES;
} procs;
-
- // Shaders
struct {
- struct {
- GLuint program;
- GLint proj;
- GLint color;
- GLint pos_attrib;
- } quad;
-
+ struct box_shadow_shader box_shadow;
+ struct blur_shader blur1;
+ struct blur_shader blur2;
+ struct corner_shader corner;
+ struct quad_shader quad;
struct rounded_quad_shader rounded_quad;
struct rounded_quad_shader rounded_tl_quad;
struct rounded_quad_shader rounded_tr_quad;
struct rounded_quad_shader rounded_bl_quad;
struct rounded_quad_shader rounded_br_quad;
-
- struct {
- GLuint program;
- GLint proj;
- GLint color;
- GLint pos_attrib;
- GLint half_size;
- GLint position;
- GLint radius;
- } stencil_mask;
-
- struct blur_shader blur1;
- struct blur_shader blur2;
-
- struct {
- GLuint program;
- GLint proj;
- GLint color;
- GLint pos_attrib;
- GLint is_top_left;
- GLint is_top_right;
- GLint is_bottom_left;
- GLint is_bottom_right;
- GLint position;
- GLint radius;
- GLint half_size;
- GLint half_thickness;
- } corner;
-
- struct {
- GLuint program;
- GLint proj;
- GLint color;
- GLint pos_attrib;
- GLint position;
- GLint size;
- GLint blur_sigma;
- GLint corner_radius;
- } box_shadow;
-
- struct gles2_tex_shader tex_rgba;
- struct gles2_tex_shader tex_rgbx;
- struct gles2_tex_shader tex_ext;
+ struct stencil_mask_shader stencil_mask;
+ struct tex_shader tex_rgba;
+ struct tex_shader tex_rgbx;
+ struct tex_shader tex_ext;
} shaders;
};