From 0b52aa9d137b03017313e028accc92dc5d536440 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Sat, 30 Dec 2023 11:25:16 +0100 Subject: Initial rebase without effects --- include/render/fx_renderer/matrix.h | 8 +- include/render/pixel_format.h | 56 ++++++++++--- include/types/wlr_buffer.h | 69 ---------------- include/types/wlr_output.h | 10 +++ include/types/wlr_scene.h | 2 + include/util/env.h | 14 +++- include/util/time.h | 8 +- include/wlr/types/wlr_scene.h | 152 +++++++++++++++++++++++++++++++----- 8 files changed, 219 insertions(+), 100 deletions(-) create mode 100644 include/types/wlr_output.h (limited to 'include') diff --git a/include/render/fx_renderer/matrix.h b/include/render/fx_renderer/matrix.h index 6931e8d..c3bae42 100644 --- a/include/render/fx_renderer/matrix.h +++ b/include/render/fx_renderer/matrix.h @@ -3,7 +3,13 @@ #include +/** + * Writes a 2D orthographic projection matrix to mat of (width, height) with a + * specified wl_output_transform. + * + * Equivalent to glOrtho(0, width, 0, height, 1, -1) with the transform applied. + */ void matrix_projection(float mat[static 9], int width, int height, - enum wl_output_transform transform); + enum wl_output_transform transform); #endif diff --git a/include/render/pixel_format.h b/include/render/pixel_format.h index d045b6a..a024ff9 100644 --- a/include/render/pixel_format.h +++ b/include/render/pixel_format.h @@ -3,24 +3,62 @@ #include +/** + * Information about a pixel format. + * + * A pixel format is identified via its DRM four character code (see ). + * + * Simple formats have a block size of 1×1 pixels and bytes_per_block contains + * the number of bytes per pixel (including padding). + * + * Tiled formats (e.g. sub-sampled YCbCr) are described with a block size + * greater than 1×1 pixels. A block is a rectangle of pixels which are stored + * next to each other in a byte-aligned memory region. + */ struct wlr_pixel_format_info { - uint32_t drm_format; + uint32_t drm_format; - /* Equivalent of the format if it has an alpha channel, - * DRM_FORMAT_INVALID (0) if NA - */ - uint32_t opaque_substitute; + /* Equivalent of the format if it has an alpha channel, + * DRM_FORMAT_INVALID (0) if NA + */ + uint32_t opaque_substitute; - /* Bits per pixels */ - uint32_t bpp; + /* Bytes per block (including padding) */ + uint32_t bytes_per_block; + /* Size of a block in pixels (zero for 1×1) */ + uint32_t block_width, block_height; - /* True if the format has an alpha channel */ - bool has_alpha; + /* True if the format has an alpha channel */ + bool has_alpha; }; +/** + * Get pixel format information from a DRM FourCC. + * + * NULL is returned if the pixel format is unknown. + */ const struct wlr_pixel_format_info *drm_get_pixel_format_info(uint32_t fmt); +/** + * Get the number of pixels per block for a pixel format. + */ +uint32_t pixel_format_info_pixels_per_block(const struct wlr_pixel_format_info *info); +/** + * Get the minimum stride for a given pixel format and width. + */ +int32_t pixel_format_info_min_stride(const struct wlr_pixel_format_info *info, int32_t width); +/** + * Check whether a stride is large enough for a given pixel format and width. + */ +bool pixel_format_info_check_stride(const struct wlr_pixel_format_info *info, + int32_t stride, int32_t width); +/** + * Convert an enum wl_shm_format to a DRM FourCC. + */ uint32_t convert_wl_shm_format_to_drm(enum wl_shm_format fmt); +/** + * Convert a DRM FourCC to an enum wl_shm_format. + */ enum wl_shm_format convert_drm_format_to_wl_shm(uint32_t fmt); #endif diff --git a/include/types/wlr_buffer.h b/include/types/wlr_buffer.h index 59d78e9..016cae8 100644 --- a/include/types/wlr_buffer.h +++ b/include/types/wlr_buffer.h @@ -3,75 +3,6 @@ #include -struct wlr_shm_client_buffer { - struct wlr_buffer base; - - uint32_t format; - size_t stride; - - // The following fields are NULL if the client has destroyed the wl_buffer - struct wl_resource *resource; - struct wl_shm_buffer *shm_buffer; - - // This is used to keep the backing storage alive after the client has - // destroyed the wl_buffer - struct wl_shm_pool *saved_shm_pool; - void *saved_data; - - struct wl_listener resource_destroy; - struct wl_listener release; -}; - -struct wlr_shm_client_buffer *shm_client_buffer_get_or_create( - struct wl_resource *resource); - -/** - * A read-only buffer that holds a data pointer. - * - * This is suitable for passing raw pixel data to a function that accepts a - * wlr_buffer. - */ -struct wlr_readonly_data_buffer { - struct wlr_buffer base; - - const void *data; - uint32_t format; - size_t stride; - - void *saved_data; -}; - -/** - * Wraps a read-only data pointer into a wlr_buffer. The data pointer may be - * accessed until readonly_data_buffer_drop() is called. - */ -struct wlr_readonly_data_buffer *readonly_data_buffer_create(uint32_t format, - size_t stride, uint32_t width, uint32_t height, const void *data); -/** - * Drops ownership of the buffer (see wlr_buffer_drop() for more details) and - * perform a copy of the data pointer if a consumer still has the buffer locked. - */ -bool readonly_data_buffer_drop(struct wlr_readonly_data_buffer *buffer); - -struct wlr_dmabuf_buffer { - struct wlr_buffer base; - struct wlr_dmabuf_attributes dmabuf; - bool saved; -}; - -/** - * Wraps a DMA-BUF into a wlr_buffer. The DMA-BUF may be accessed until - * dmabuf_buffer_drop() is called. - */ -struct wlr_dmabuf_buffer *dmabuf_buffer_create( - struct wlr_dmabuf_attributes *dmabuf); -/** - * Drops ownership of the buffer (see wlr_buffer_drop() for more details) and - * takes a reference to the DMA-BUF (by dup'ing its file descriptors) if a - * consumer still has the buffer locked. - */ -bool dmabuf_buffer_drop(struct wlr_dmabuf_buffer *buffer); - /** * Check whether a buffer is fully opaque. * diff --git a/include/types/wlr_output.h b/include/types/wlr_output.h new file mode 100644 index 0000000..b239b6a --- /dev/null +++ b/include/types/wlr_output.h @@ -0,0 +1,10 @@ +#ifndef TYPES_WLR_OUTPUT_H +#define TYPES_WLR_OUTPUT_H + +#include +#include + +void output_pending_resolution(struct wlr_output *output, + const struct wlr_output_state *state, int *width, int *height); + +#endif diff --git a/include/types/wlr_scene.h b/include/types/wlr_scene.h index 64c11bc..80dcfd1 100644 --- a/include/types/wlr_scene.h +++ b/include/types/wlr_scene.h @@ -5,4 +5,6 @@ struct wlr_scene *scene_node_get_root(struct wlr_scene_node *node); +void scene_surface_set_clip(struct wlr_scene_surface *surface, struct wlr_box *clip); + #endif diff --git a/include/util/env.h b/include/util/env.h index 6720fa8..e271f4b 100644 --- a/include/util/env.h +++ b/include/util/env.h @@ -4,8 +4,20 @@ #include #include +/** + * Parse a bool from an environment variable. + * + * On success, the parsed value is returned. On error, false is returned. + */ bool env_parse_bool(const char *option); -ssize_t env_parse_switch(const char *option, const char **switches); +/** + * Pick a choice from an environment variable. + * + * On success, the choice index is returned. On error, zero is returned. + * + * switches is a NULL-terminated array. + */ +size_t env_parse_switch(const char *option, const char **switches); #endif diff --git a/include/util/time.h b/include/util/time.h index 287698d..3f76aa4 100644 --- a/include/util/time.h +++ b/include/util/time.h @@ -1,18 +1,24 @@ #ifndef UTIL_TIME_H #define UTIL_TIME_H +#include #include /** * Get the current time, in milliseconds. */ -uint32_t get_current_time_msec(void); +int64_t get_current_time_msec(void); /** * Convert a timespec to milliseconds. */ int64_t timespec_to_msec(const struct timespec *a); +/** + * Convert a timespec to nanoseconds. + */ +int64_t timespec_to_nsec(const struct timespec *a); + /** * Convert nanoseconds to a timespec. */ diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 7b4c002..f52e167 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -20,21 +20,33 @@ */ #include +#include #include -#include +#include #include #include "types/fx/shadow_data.h" +#include +#include +#include struct wlr_output; struct wlr_output_layout; +struct wlr_output_layout_output; struct wlr_xdg_surface; struct wlr_layer_surface_v1; +struct wlr_drag_icon; +struct wlr_surface; struct wlr_scene_node; struct wlr_scene_buffer; +struct wlr_scene_output_layout; + +struct wlr_presentation; +struct wlr_linux_dmabuf_v1; +struct wlr_output_state; typedef bool (*wlr_scene_buffer_point_accepts_input_func_t)( - struct wlr_scene_buffer *buffer, int sx, int sy); + struct wlr_scene_buffer *buffer, double *sx, double *sy); typedef void (*wlr_scene_buffer_iterator_func_t)( struct wlr_scene_buffer *buffer, int sx, int sy, void *user_data); @@ -89,10 +101,12 @@ struct wlr_scene { // May be NULL struct wlr_presentation *presentation; + struct wlr_linux_dmabuf_v1 *linux_dmabuf_v1; // private state struct wl_listener presentation_destroy; + struct wl_listener linux_dmabuf_v1_destroy; enum wlr_scene_debug_damage_option debug_damage_option; bool direct_scanout; @@ -106,11 +120,14 @@ struct wlr_scene_surface { // private state + struct wlr_box clip; + struct wlr_addon addon; + struct wl_listener outputs_update; struct wl_listener output_enter; struct wl_listener output_leave; - struct wl_listener output_present; + struct wl_listener output_sample; struct wl_listener frame_done; struct wl_listener surface_destroy; struct wl_listener surface_commit; @@ -123,6 +140,16 @@ struct wlr_scene_rect { float color[4]; }; +struct wlr_scene_outputs_update_event { + struct wlr_scene_output **active; + size_t size; +}; + +struct wlr_scene_output_sample_event { + struct wlr_scene_output *output; + bool direct_scanout; +}; + /** A scene-graph node displaying a buffer */ struct wlr_scene_buffer { struct wlr_scene_node node; @@ -131,9 +158,10 @@ struct wlr_scene_buffer { struct wlr_buffer *buffer; struct { + struct wl_signal outputs_update; // struct wlr_scene_outputs_update_event struct wl_signal output_enter; // struct wlr_scene_output struct wl_signal output_leave; // struct wlr_scene_output - struct wl_signal output_present; // struct wlr_scene_output + struct wl_signal output_sample; // struct wlr_scene_output_sample_event struct wl_signal frame_done; // struct timespec } events; @@ -148,18 +176,20 @@ struct wlr_scene_buffer { */ struct wlr_scene_output *primary_output; - // private state - float opacity; int corner_radius; struct shadow_data shadow_data; - - uint64_t active_outputs; - struct wlr_texture *texture; + enum wlr_scale_filter_mode filter_mode; struct wlr_fbox src_box; int dst_width, dst_height; enum wl_output_transform transform; pixman_region32_t opaque_region; + + // private state + + uint64_t active_outputs; + struct wlr_texture *texture; + struct wlr_linux_dmabuf_feedback_v1_init_options prev_feedback_options; }; /** A viewport for an output in the scene-graph */ @@ -183,7 +213,6 @@ struct wlr_scene_output { bool prev_scanout; struct wl_listener output_commit; - struct wl_listener output_mode; struct wl_listener output_damage; struct wl_listener output_needs_frame; @@ -192,6 +221,11 @@ struct wlr_scene_output { struct wl_array render_list; }; +struct wlr_scene_timer { + int64_t pre_render_duration; + struct wlr_render_timer *render_timer; +}; + /** A layer shell scene helper */ struct wlr_scene_layer_surface_v1 { struct wlr_scene_tree *tree; @@ -269,6 +303,7 @@ struct wlr_scene_node *wlr_scene_node_at(struct wlr_scene_node *node, * Create a new scene-graph. */ struct wlr_scene *wlr_scene_create(void); + /** * Handle presentation feedback for all surfaces in the scene, assuming that * scene outputs and the scene rendering functions are used. @@ -278,6 +313,15 @@ struct wlr_scene *wlr_scene_create(void); void wlr_scene_set_presentation(struct wlr_scene *scene, struct wlr_presentation *presentation); +/** + * Handles linux_dmabuf_v1 feedback for all surfaces in the scene. + * + * Asserts that a struct wlr_linux_dmabuf_v1 hasn't already been set for the scene. + */ +void wlr_scene_set_linux_dmabuf_v1(struct wlr_scene *scene, + struct wlr_linux_dmabuf_v1 *linux_dmabuf_v1); + + /** * Add a node displaying nothing but its children. */ @@ -295,13 +339,29 @@ struct wlr_scene_tree *wlr_scene_tree_create(struct wlr_scene_tree *parent); struct wlr_scene_surface *wlr_scene_surface_create(struct wlr_scene_tree *parent, struct wlr_surface *surface); +/** + * If this node represents a wlr_scene_buffer, that buffer will be returned. It + * is not legal to feed a node that does not represent a wlr_scene_buffer. + */ struct wlr_scene_buffer *wlr_scene_buffer_from_node(struct wlr_scene_node *node); +/** + * If this node represents a wlr_scene_tree, that tree will be returned. It + * is not legal to feed a node that does not represent a wlr_scene_tree. + */ +struct wlr_scene_tree *wlr_scene_tree_from_node(struct wlr_scene_node *node); + +/** + * If this node represents a wlr_scene_rect, that rect will be returned. It + * is not legal to feed a node that does not represent a wlr_scene_rect. + */ +struct wlr_scene_rect *wlr_scene_rect_from_node(struct wlr_scene_node *node); + /** * If this buffer is backed by a surface, then the struct wlr_scene_surface is * returned. If not, NULL will be returned. */ -struct wlr_scene_surface *wlr_scene_surface_from_buffer( +struct wlr_scene_surface *wlr_scene_surface_try_from_buffer( struct wlr_scene_buffer *scene_buffer); /** @@ -343,14 +403,14 @@ void wlr_scene_buffer_set_buffer(struct wlr_scene_buffer *scene_buffer, * the whole buffer node will be damaged. */ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buffer, - struct wlr_buffer *buffer, pixman_region32_t *region); + struct wlr_buffer *buffer, const pixman_region32_t *region); /** * Sets the buffer's opaque region. This is an optimization hint used to * determine if buffers which reside under this one need to be rendered or not. */ void wlr_scene_buffer_set_opaque_region(struct wlr_scene_buffer *scene_buffer, - pixman_region32_t *region); + const pixman_region32_t *region); /** * Set the source rectangle describing the region of the buffer which will be @@ -383,6 +443,12 @@ void wlr_scene_buffer_set_transform(struct wlr_scene_buffer *scene_buffer, void wlr_scene_buffer_set_opacity(struct wlr_scene_buffer *scene_buffer, float opacity); +/** +* Sets the filter mode to use when scaling the buffer +*/ +void wlr_scene_buffer_set_filter_mode(struct wlr_scene_buffer *scene_buffer, + enum wlr_scale_filter_mode filter_mode); + /** * Sets the corner radius of this buffer */ @@ -417,10 +483,32 @@ void wlr_scene_output_destroy(struct wlr_scene_output *scene_output); */ void wlr_scene_output_set_position(struct wlr_scene_output *scene_output, int lx, int ly); + +struct wlr_scene_output_state_options { + struct wlr_scene_timer *timer; +}; + /** * Render and commit an output. */ -bool wlr_scene_output_commit(struct wlr_scene_output *scene_output); +bool wlr_scene_output_commit(struct wlr_scene_output *scene_output, + const struct wlr_scene_output_state_options *options); + +/** + * Render and populate given output state. + */ +bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, + struct wlr_output_state *state, const struct wlr_scene_output_state_options *options); + +/** + * Retrieve the duration in nanoseconds between the last wlr_scene_output_commit() call and the end + * of its operations, including those on the GPU that may have finished after the call returned. + * + * Returns -1 if the duration is unavailable. + */ +int64_t wlr_scene_timer_get_duration_ns(struct wlr_scene_timer *timer); +void wlr_scene_timer_finish(struct wlr_scene_timer *timer); + /** * Call wlr_surface_send_frame_done() on all surfaces in the scene rendered by * wlr_scene_output_commit() for which wlr_scene_surface.primary_output @@ -446,14 +534,23 @@ struct wlr_scene_output *wlr_scene_get_scene_output(struct wlr_scene *scene, /** * Attach an output layout to a scene. * - * Adding, removing, or repositioning an output in the output layout - * will respectively add, remove or reposition a corresponding - * scene-graph output. When the output layout is destroyed, scene-graph - * outputs which were created by this helper will be destroyed. + * The resulting scene output layout allows to synchronize the positions of scene + * outputs with the positions of corresponding layout outputs. + * + * It is automatically destroyed when the scene or the output layout is destroyed. */ -bool wlr_scene_attach_output_layout(struct wlr_scene *scene, +struct wlr_scene_output_layout *wlr_scene_attach_output_layout(struct wlr_scene *scene, struct wlr_output_layout *output_layout); +/** + * Add an output to the scene output layout. + * + * When the layout output is repositioned, the scene output will be repositioned + * accordingly. + */ +void wlr_scene_output_layout_add_output(struct wlr_scene_output_layout *sol, + struct wlr_output_layout_output *lo, struct wlr_scene_output *so); + /** * Add a node displaying a surface and all of its sub-surfaces to the * scene-graph. @@ -461,6 +558,16 @@ bool wlr_scene_attach_output_layout(struct wlr_scene *scene, struct wlr_scene_tree *wlr_scene_subsurface_tree_create( struct wlr_scene_tree *parent, struct wlr_surface *surface); +/** + * Sets a cropping region for any subsurface trees that are children of this + * scene node. The clip coordinate space will be that of the root surface of + * the subsurface tree. + * + * A NULL or empty clip will disable clipping + */ +void wlr_scene_subsurface_tree_set_clip(struct wlr_scene_node *node, + struct wlr_box *clip); + /** * Add a node displaying an xdg_surface and all of its sub-surfaces to the * scene-graph. @@ -495,4 +602,11 @@ void wlr_scene_layer_surface_v1_configure( struct wlr_scene_layer_surface_v1 *scene_layer_surface, const struct wlr_box *full_area, struct wlr_box *usable_area); +/** + * Add a node displaying a drag icon and all its sub-surfaces to the + * scene-graph. + */ +struct wlr_scene_tree *wlr_scene_drag_icon_create( + struct wlr_scene_tree *parent, struct wlr_drag_icon *drag_icon); + #endif -- cgit v1.2.3 From b6a990da71b5b0947650a50dcf1a083acfce868c Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Sat, 30 Dec 2023 12:45:04 +0100 Subject: Added fx_texture and fx_framebuffer --- include/render/egl.h | 117 +++++++++++++++++++++++++++++++ include/render/fx_renderer/fx_renderer.h | 99 ++++++++++++++++++++++++-- 2 files changed, 211 insertions(+), 5 deletions(-) create mode 100644 include/render/egl.h (limited to 'include') diff --git a/include/render/egl.h b/include/render/egl.h new file mode 100644 index 0000000..e8b8596 --- /dev/null +++ b/include/render/egl.h @@ -0,0 +1,117 @@ +#ifndef RENDER_EGL_H +#define RENDER_EGL_H + +#include + +struct wlr_egl { + EGLDisplay display; + EGLContext context; + EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT + struct gbm_device *gbm_device; + + struct { + // Display extensions + bool KHR_image_base; + bool EXT_image_dma_buf_import; + bool EXT_image_dma_buf_import_modifiers; + bool IMG_context_priority; + bool EXT_create_context_robustness; + + // Device extensions + bool EXT_device_drm; + bool EXT_device_drm_render_node; + + // Client extensions + bool EXT_device_query; + bool KHR_platform_gbm; + bool EXT_platform_device; + bool KHR_display_reference; + } exts; + + struct { + PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT; + PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; + PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR; + PFNEGLQUERYDMABUFFORMATSEXTPROC eglQueryDmaBufFormatsEXT; + PFNEGLQUERYDMABUFMODIFIERSEXTPROC eglQueryDmaBufModifiersEXT; + PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR; + PFNEGLQUERYDISPLAYATTRIBEXTPROC eglQueryDisplayAttribEXT; + PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT; + PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT; + } procs; + + bool has_modifiers; + struct wlr_drm_format_set dmabuf_texture_formats; + struct wlr_drm_format_set dmabuf_render_formats; +}; + +struct wlr_egl_context { + EGLDisplay display; + EGLContext context; + EGLSurface draw_surface; + EGLSurface read_surface; +}; + +/** + * Initializes an EGL context for the given DRM FD. + * + * Will attempt to load all possibly required API functions. + */ +struct wlr_egl *wlr_egl_create_with_drm_fd(int drm_fd); + +/** + * Frees all related EGL resources, makes the context not-current and + * unbinds a bound wayland display. + */ +void wlr_egl_destroy(struct wlr_egl *egl); + +/** + * Creates an EGL image from the given dmabuf attributes. Check usability + * of the dmabuf with wlr_egl_check_import_dmabuf once first. + */ +EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl, + struct wlr_dmabuf_attributes *attributes, bool *external_only); + +/** + * Get DMA-BUF formats suitable for sampling usage. + */ +const struct wlr_drm_format_set *wlr_egl_get_dmabuf_texture_formats( + struct wlr_egl *egl); +/** + * Get DMA-BUF formats suitable for rendering usage. + */ +const struct wlr_drm_format_set *wlr_egl_get_dmabuf_render_formats( + struct wlr_egl *egl); + +/** + * Destroys an EGL image created with the given wlr_egl. + */ +bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImageKHR image); + +int wlr_egl_dup_drm_fd(struct wlr_egl *egl); + +/** + * Save the current EGL context to the structure provided in the argument. + * + * This includes display, context, draw surface and read surface. + */ +void wlr_egl_save_context(struct wlr_egl_context *context); + +/** + * Restore EGL context that was previously saved using wlr_egl_save_current(). + */ +bool wlr_egl_restore_context(struct wlr_egl_context *context); + +/** + * Make the EGL context current. + * + * Callers are expected to clear the current context when they are done by + * calling wlr_egl_unset_current(). + */ +bool wlr_egl_make_current(struct wlr_egl *egl); + +bool wlr_egl_unset_current(struct wlr_egl *egl); + +bool wlr_egl_is_current(struct wlr_egl *egl); + +#endif diff --git a/include/render/fx_renderer/fx_renderer.h b/include/render/fx_renderer/fx_renderer.h index f569aa9..ffd31da 100644 --- a/include/render/fx_renderer/fx_renderer.h +++ b/include/render/fx_renderer/fx_renderer.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -57,19 +58,70 @@ struct box_shadow_shader { GLint corner_radius; }; +struct fx_framebuffer { + bool initialized; + + GLuint fbo; + GLuint rbo; + + struct wlr_buffer *wlr_buffer; + struct fx_renderer *renderer; + struct wl_list link; // fx_renderer.buffers + struct wlr_addon addon; + + EGLImageKHR image; +}; + +struct fx_texture { + struct wlr_texture wlr_texture; + struct fx_renderer *fx_renderer; + struct wl_list link; // fx_renderer.textures + + // Basically: + // GL_TEXTURE_2D == mutable + // GL_TEXTURE_EXTERNAL_OES == immutable + GLuint target; + GLuint tex; + + EGLImageKHR image; + + bool has_alpha; + + // Only affects target == GL_TEXTURE_2D + uint32_t drm_format; // used to interpret upload data + // If imported from a wlr_buffer + struct wlr_buffer *buffer; + struct wlr_addon buffer_addon; +}; + struct fx_renderer { float projection[9]; + int viewport_width, viewport_height; + + struct wlr_output *wlr_output; + + struct wlr_egl *egl; + struct fx_stencilbuffer stencil_buffer; + struct wl_list textures; // fx_texture.link + struct wl_list buffers; // fx_framebuffer.link + + // The FBO and texture used by wlroots + GLuint wlr_main_buffer_fbo; + struct wlr_gles2_texture_attribs wlr_main_texture_attribs; + struct wlr_addon addon; struct { bool OES_egl_image_external; + bool OES_egl_image; } exts; struct { PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; + PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES; } procs; struct { @@ -82,18 +134,55 @@ struct fx_renderer { } shaders; }; -void fx_renderer_init_addon(struct wlr_egl *egl, struct wlr_addon_set *addons, - const void * owner); +/// +/// fx_framebuffer +/// + +struct fx_framebuffer fx_framebuffer_create(void); + +void fx_framebuffer_bind(struct fx_framebuffer *buffer); + +void fx_framebuffer_bind_wlr_fbo(struct fx_renderer *renderer); + +void fx_framebuffer_update(struct fx_renderer *fx_renderer, struct fx_framebuffer *fx_buffer, + int width, int height); + +void fx_framebuffer_add_stencil_buffer(struct fx_framebuffer *buffer, int width, int height); + +void fx_framebuffer_release(struct fx_framebuffer *buffer); + +/// +/// fx_texture +/// + +struct fx_texture *fx_get_texture(struct wlr_texture *wlr_texture); + +struct fx_texture *fx_texture_from_buffer(struct fx_renderer *fx_renderer, + struct wlr_buffer *buffer); + +void fx_texture_destroy(struct fx_texture *texture); + +bool wlr_texture_is_fx(struct wlr_texture *wlr_texture); + +void wlr_gles2_texture_get_fx_attribs(struct fx_texture *texture, + struct wlr_gles2_texture_attribs *attribs); + +/// +/// fx_renderer +/// + +void fx_renderer_init_addon(struct wlr_egl *egl, struct wlr_output *output, + struct wlr_addon_set *addons, const void * owner); struct fx_renderer *fx_renderer_addon_find(struct wlr_addon_set *addons, const void * owner); -struct fx_renderer *fx_renderer_create(struct wlr_egl *egl); - -void fx_renderer_fini(struct fx_renderer *renderer); +struct fx_renderer *fx_renderer_create(struct wlr_egl *egl, struct wlr_output *output); void fx_renderer_begin(struct fx_renderer *renderer, int width, int height); +void fx_renderer_end(struct fx_renderer *renderer); + void fx_renderer_clear(const float color[static 4]); void fx_renderer_scissor(struct wlr_box *box); -- cgit v1.2.3 From 51c7078b9ec413ebd8316501f01ccf769a090f64 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Sun, 31 Dec 2023 00:32:39 +0100 Subject: 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) --- include/render/fx_renderer/fx_renderer.h | 230 +++++++++++++++---------------- include/render/fx_renderer/shaders.h | 69 ++++++++++ include/render/fx_renderer/util.h | 11 ++ include/render/pass.h | 52 +++++++ include/render/pixel_format.h | 4 +- 5 files changed, 246 insertions(+), 120 deletions(-) create mode 100644 include/render/fx_renderer/shaders.h create mode 100644 include/render/fx_renderer/util.h create mode 100644 include/render/pass.h (limited to 'include') diff --git a/include/render/fx_renderer/fx_renderer.h b/include/render/fx_renderer/fx_renderer.h index ffd31da..6483f12 100644 --- a/include/render/fx_renderer/fx_renderer.h +++ b/include/render/fx_renderer/fx_renderer.h @@ -4,74 +4,63 @@ #include #include #include +#include #include -#include +#include #include #include #include + #include "render/fx_renderer/fx_stencilbuffer.h" +#include "render/fx_renderer/shaders.h" +#include "render/pass.h" #include "types/fx/shadow_data.h" -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 fx_pixel_format { + uint32_t drm_format; + // optional field, if empty then internalformat = format + GLint gl_internalformat; + GLint gl_format, gl_type; + bool has_alpha; }; -struct tex_shader { - GLuint program; - GLint proj; - GLint tex; - GLint alpha; - GLint pos_attrib; - GLint tex_attrib; - GLint size; - GLint position; - GLint radius; -}; +bool is_fx_pixel_format_supported(const struct fx_renderer *renderer, + const struct fx_pixel_format *format); +const struct fx_pixel_format *get_fx_format_from_drm(uint32_t fmt); +const struct fx_pixel_format *get_fx_format_from_gl( + GLint gl_format, GLint gl_type, bool alpha); +const uint32_t *get_fx_shm_formats(const struct fx_renderer *renderer, + size_t *len); -struct stencil_mask_shader { - GLuint program; - GLint proj; - GLint color; - GLint pos_attrib; - GLint half_size; - GLint position; - GLint radius; -}; - -struct box_shadow_shader { - GLuint program; - GLint proj; - GLint color; - GLint pos_attrib; - GLint position; - GLint size; - GLint blur_sigma; - GLint corner_radius; -}; +/// +/// fx_framebuffer +/// struct fx_framebuffer { - bool initialized; - - GLuint fbo; - GLuint rbo; - - struct wlr_buffer *wlr_buffer; + struct wlr_buffer *buffer; struct fx_renderer *renderer; struct wl_list link; // fx_renderer.buffers - struct wlr_addon addon; EGLImageKHR image; + GLuint rbo; + GLuint fbo; + + struct wlr_addon addon; }; +struct fx_framebuffer *fx_framebuffer_get_or_create(struct fx_renderer *renderer, + struct wlr_buffer *wlr_buffer); + +void fx_framebuffer_bind(struct fx_framebuffer *buffer); + +void fx_framebuffer_bind_wlr_fbo(struct fx_renderer *renderer); + +void fx_framebuffer_destroy(struct fx_framebuffer *buffer); + +/// +/// fx_texture +/// + struct fx_texture { struct wlr_texture wlr_texture; struct fx_renderer *fx_renderer; @@ -94,34 +83,62 @@ struct fx_texture { struct wlr_addon buffer_addon; }; -struct fx_renderer { - float projection[9]; +struct fx_texture_attribs { + GLenum target; /* either GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES */ + GLuint tex; - int viewport_width, viewport_height; + bool has_alpha; +}; - struct wlr_output *wlr_output; +struct fx_texture *fx_get_texture(struct wlr_texture *wlr_texture); - struct wlr_egl *egl; +struct wlr_texture *fx_texture_from_buffer(struct wlr_renderer *wlr_renderer, + struct wlr_buffer *buffer); - struct fx_stencilbuffer stencil_buffer; +void fx_texture_destroy(struct fx_texture *texture); - struct wl_list textures; // fx_texture.link - struct wl_list buffers; // fx_framebuffer.link +bool wlr_texture_is_fx(struct wlr_texture *wlr_texture); - // The FBO and texture used by wlroots - GLuint wlr_main_buffer_fbo; - struct wlr_gles2_texture_attribs wlr_main_texture_attribs; +void fx_texture_get_attribs(struct wlr_texture *texture, + struct fx_texture_attribs *attribs); - struct wlr_addon addon; +/// +/// fx_renderer +/// +struct fx_renderer { + struct wlr_renderer wlr_renderer; + + float projection[9]; + struct wlr_egl *egl; + int drm_fd; + + const char *exts_str; struct { + bool EXT_read_format_bgra; + bool KHR_debug; bool OES_egl_image_external; bool OES_egl_image; + bool EXT_texture_type_2_10_10_10_REV; + bool OES_texture_half_float_linear; + bool EXT_texture_norm16; + bool EXT_disjoint_timer_query; } exts; struct { PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; + PFNGLDEBUGMESSAGECALLBACKKHRPROC glDebugMessageCallbackKHR; + PFNGLDEBUGMESSAGECONTROLKHRPROC glDebugMessageControlKHR; + PFNGLPOPDEBUGGROUPKHRPROC glPopDebugGroupKHR; + PFNGLPUSHDEBUGGROUPKHRPROC glPushDebugGroupKHR; PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC glEGLImageTargetRenderbufferStorageOES; + PFNGLGETGRAPHICSRESETSTATUSKHRPROC glGetGraphicsResetStatusKHR; + PFNGLGENQUERIESEXTPROC glGenQueriesEXT; + PFNGLDELETEQUERIESEXTPROC glDeleteQueriesEXT; + PFNGLQUERYCOUNTEREXTPROC glQueryCounterEXT; + PFNGLGETQUERYOBJECTIVEXTPROC glGetQueryObjectivEXT; + PFNGLGETQUERYOBJECTUI64VEXTPROC glGetQueryObjectui64vEXT; + PFNGLGETINTEGER64VEXTPROC glGetInteger64vEXT; } procs; struct { @@ -132,60 +149,35 @@ struct fx_renderer { struct box_shadow_shader box_shadow; struct stencil_mask_shader stencil_mask; } shaders; -}; - -/// -/// fx_framebuffer -/// - -struct fx_framebuffer fx_framebuffer_create(void); - -void fx_framebuffer_bind(struct fx_framebuffer *buffer); - -void fx_framebuffer_bind_wlr_fbo(struct fx_renderer *renderer); - -void fx_framebuffer_update(struct fx_renderer *fx_renderer, struct fx_framebuffer *fx_buffer, - int width, int height); - -void fx_framebuffer_add_stencil_buffer(struct fx_framebuffer *buffer, int width, int height); - -void fx_framebuffer_release(struct fx_framebuffer *buffer); - -/// -/// fx_texture -/// - -struct fx_texture *fx_get_texture(struct wlr_texture *wlr_texture); - -struct fx_texture *fx_texture_from_buffer(struct fx_renderer *fx_renderer, - struct wlr_buffer *buffer); - -void fx_texture_destroy(struct fx_texture *texture); - -bool wlr_texture_is_fx(struct wlr_texture *wlr_texture); - -void wlr_gles2_texture_get_fx_attribs(struct fx_texture *texture, - struct wlr_gles2_texture_attribs *attribs); -/// -/// fx_renderer -/// + struct wl_list buffers; // fx_framebuffer.link + struct wl_list textures; // fx_texture.link -void fx_renderer_init_addon(struct wlr_egl *egl, struct wlr_output *output, - struct wlr_addon_set *addons, const void * owner); + struct fx_stencilbuffer stencil_buffer; -struct fx_renderer *fx_renderer_addon_find(struct wlr_addon_set *addons, - const void * owner); + struct fx_framebuffer *current_buffer; + uint32_t viewport_width, viewport_height; +}; -struct fx_renderer *fx_renderer_create(struct wlr_egl *egl, struct wlr_output *output); +bool wlr_renderer_is_fx(struct wlr_renderer *wlr_renderer); -void fx_renderer_begin(struct fx_renderer *renderer, int width, int height); +struct fx_renderer *fx_get_renderer( + struct wlr_renderer *wlr_renderer); +struct fx_render_timer *fx_get_render_timer( + struct wlr_render_timer *timer); +struct fx_texture *fx_get_texture( + struct wlr_texture *wlr_texture); -void fx_renderer_end(struct fx_renderer *renderer); +struct wlr_renderer *fx_renderer_create_with_drm_fd(int drm_fd); +struct wlr_renderer *fx_renderer_create(struct wlr_backend *backend); +struct wlr_renderer *fx_renderer_create_egl(struct wlr_egl *egl); -void fx_renderer_clear(const float color[static 4]); +struct wlr_egl *wlr_fx_renderer_get_egl(struct wlr_renderer *renderer); -void fx_renderer_scissor(struct wlr_box *box); +void push_fx_debug_(struct fx_renderer *renderer, + const char *file, const char *func); +#define push_fx_debug(renderer) push_fx_debug_(renderer, _WLR_FILENAME, __func__) +void pop_fx_debug(struct fx_renderer *renderer); // Initialize the stenciling work void fx_renderer_stencil_mask_init(void); @@ -200,17 +192,19 @@ void fx_renderer_stencil_enable(void); void fx_renderer_stencil_disable(void); -bool fx_render_subtexture_with_matrix(struct fx_renderer *renderer, - struct wlr_texture *wlr_texture, const struct wlr_fbox *src_box, - const struct wlr_box *dst_box, const float matrix[static 9], - float opacity, int corner_radius); +/// +/// Render Timer +/// -void fx_render_rect(struct fx_renderer *renderer, const struct wlr_box *box, - const float color[static 4], const float projection[static 9]); +struct fx_render_timer { + struct wlr_render_timer base; + struct fx_renderer *renderer; + struct timespec cpu_start; + struct timespec cpu_end; + GLuint id; + GLint64 gl_cpu_end; +}; -void fx_render_box_shadow(struct fx_renderer *renderer, - const struct wlr_box *box, const struct wlr_box *stencil_box, - const float matrix[static 9], int corner_radius, - struct shadow_data *shadow_data); +bool wlr_render_timer_is_fx(struct wlr_render_timer *timer); #endif 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 +#include + +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 diff --git a/include/render/fx_renderer/util.h b/include/render/fx_renderer/util.h new file mode 100644 index 0000000..c0afc69 --- /dev/null +++ b/include/render/fx_renderer/util.h @@ -0,0 +1,11 @@ +#ifndef _FX_UTIL_H +#define _FX_UTIL_H + +#include +#include +#include + +bool open_preferred_drm_fd(struct wlr_backend *backend, int *drm_fd_ptr, + bool *own_drm_fd); + +#endif diff --git a/include/render/pass.h b/include/render/pass.h new file mode 100644 index 0000000..9551f81 --- /dev/null +++ b/include/render/pass.h @@ -0,0 +1,52 @@ +#ifndef FX_RENDER_PASS_H +#define FX_RENDER_PASS_H + +#include +#include +#include +#include + +struct fx_gles_render_pass { + struct wlr_render_pass base; + struct fx_framebuffer *buffer; + float projection_matrix[9]; + struct fx_render_timer *timer; +}; + +/** + * Begin a new render pass with the supplied destination buffer. + * + * Callers must call wlr_render_pass_submit() once they are done with the + * render pass. + */ +struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(struct wlr_renderer *renderer, + struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options); + +struct fx_render_texture_options { + struct wlr_render_texture_options base; + int corner_radius; +}; + +struct fx_render_texture_options fx_render_texture_options_default( + const struct wlr_render_texture_options *base); + +struct fx_render_rect_options { + struct wlr_render_rect_options base; +}; + +struct fx_render_rect_options fx_render_rect_options_default( + const struct wlr_render_rect_options *base); + +/** + * Render a fx texture. + */ +void fx_render_pass_add_texture(struct fx_gles_render_pass *render_pass, + const struct fx_render_texture_options *options); + +/** + * Render a rectangle. + */ +void fx_render_pass_add_rect(struct fx_gles_render_pass *render_pass, + const struct fx_render_rect_options *options); + +#endif diff --git a/include/render/pixel_format.h b/include/render/pixel_format.h index a024ff9..6ca11f3 100644 --- a/include/render/pixel_format.h +++ b/include/render/pixel_format.h @@ -1,5 +1,5 @@ -#ifndef RENDER_PIXEL_FORMAT_H -#define RENDER_PIXEL_FORMAT_H +#ifndef FX_RENDER_PIXEL_FORMAT_H +#define FX_RENDER_PIXEL_FORMAT_H #include -- cgit v1.2.3 From 1a6918f948be034e65c50af8969d090b5e762dc1 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:15:34 +0100 Subject: Integrated the stencil rb into fx_framebuffer Every fx_framebuffer will now have a stencil buffer --- include/render/fx_renderer/fx_renderer.h | 4 +--- include/render/fx_renderer/fx_stencilbuffer.h | 20 -------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 include/render/fx_renderer/fx_stencilbuffer.h (limited to 'include') diff --git a/include/render/fx_renderer/fx_renderer.h b/include/render/fx_renderer/fx_renderer.h index 6483f12..d62d6b4 100644 --- a/include/render/fx_renderer/fx_renderer.h +++ b/include/render/fx_renderer/fx_renderer.h @@ -11,7 +11,6 @@ #include #include -#include "render/fx_renderer/fx_stencilbuffer.h" #include "render/fx_renderer/shaders.h" #include "render/pass.h" #include "types/fx/shadow_data.h" @@ -44,6 +43,7 @@ struct fx_framebuffer { EGLImageKHR image; GLuint rbo; GLuint fbo; + GLuint sb; // Stencil struct wlr_addon addon; }; @@ -153,8 +153,6 @@ struct fx_renderer { struct wl_list buffers; // fx_framebuffer.link struct wl_list textures; // fx_texture.link - struct fx_stencilbuffer stencil_buffer; - struct fx_framebuffer *current_buffer; uint32_t viewport_width, viewport_height; }; diff --git a/include/render/fx_renderer/fx_stencilbuffer.h b/include/render/fx_renderer/fx_stencilbuffer.h deleted file mode 100644 index 6909f96..0000000 --- a/include/render/fx_renderer/fx_stencilbuffer.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef FX_STENCILBUFFER_H -#define FX_STENCILBUFFER_H - -#include -#include -#include - -struct fx_stencilbuffer { - GLuint rb; - int width; - int height; -}; - -struct fx_stencilbuffer fx_stencilbuffer_create(void); - -void fx_stencilbuffer_init(struct fx_stencilbuffer *stencil_buffer, int width, int height); - -void fx_stencilbuffer_release(struct fx_stencilbuffer *stencil_buffer); - -#endif -- cgit v1.2.3 From c15af4a182314d8384fc6b28e7c3fc58c0352b83 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 2 Jan 2024 01:19:48 +0100 Subject: Added back shadow effect --- include/render/fx_renderer/fx_renderer.h | 13 ------------- include/render/fx_renderer/shaders.h | 8 ++------ include/render/pass.h | 15 +++++++++++++++ include/types/fx/shadow_data.h | 3 ++- 4 files changed, 19 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/render/fx_renderer/fx_renderer.h b/include/render/fx_renderer/fx_renderer.h index d62d6b4..4d99866 100644 --- a/include/render/fx_renderer/fx_renderer.h +++ b/include/render/fx_renderer/fx_renderer.h @@ -177,19 +177,6 @@ void push_fx_debug_(struct fx_renderer *renderer, #define push_fx_debug(renderer) push_fx_debug_(renderer, _WLR_FILENAME, __func__) void pop_fx_debug(struct fx_renderer *renderer); -// Initialize the stenciling work -void fx_renderer_stencil_mask_init(void); - -// Close the mask -void fx_renderer_stencil_mask_close(bool draw_inside_mask); - -// Finish stenciling and clear the buffer -void fx_renderer_stencil_mask_fini(void); - -void fx_renderer_stencil_enable(void); - -void fx_renderer_stencil_disable(void); - /// /// Render Timer /// diff --git a/include/render/fx_renderer/shaders.h b/include/render/fx_renderer/shaders.h index 584b18e..92a14d5 100644 --- a/include/render/fx_renderer/shaders.h +++ b/include/render/fx_renderer/shaders.h @@ -42,24 +42,20 @@ struct tex_shader { struct stencil_mask_shader { GLuint program; GLint proj; - GLint tex_proj; - GLint tex; + GLint color; 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 color; GLint pos_attrib; GLint position; GLint size; - GLint color; GLint blur_sigma; GLint corner_radius; }; diff --git a/include/render/pass.h b/include/render/pass.h index 9551f81..ec38a73 100644 --- a/include/render/pass.h +++ b/include/render/pass.h @@ -5,6 +5,7 @@ #include #include #include +#include "types/fx/shadow_data.h" struct fx_gles_render_pass { struct wlr_render_pass base; @@ -24,6 +25,7 @@ struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(struct wlr_renderer *r struct fx_render_texture_options { struct wlr_render_texture_options base; + struct wlr_box *clip_box; // Used to clip csd. Ignored if NULL int corner_radius; }; @@ -49,4 +51,17 @@ void fx_render_pass_add_texture(struct fx_gles_render_pass *render_pass, void fx_render_pass_add_rect(struct fx_gles_render_pass *render_pass, const struct fx_render_rect_options *options); +/** + * Render a stencil mask. + */ +void fx_render_pass_add_stencil_mask(struct fx_gles_render_pass *pass, + const struct fx_render_rect_options *fx_options, int corner_radius); + +/** + * Render a box shadow. + */ +void fx_render_pass_add_box_shadow(struct fx_gles_render_pass *pass, + const struct fx_render_rect_options *fx_options, + int corner_radius, struct shadow_data *shadow_data); + #endif diff --git a/include/types/fx/shadow_data.h b/include/types/fx/shadow_data.h index 804acfe..d96a084 100644 --- a/include/types/fx/shadow_data.h +++ b/include/types/fx/shadow_data.h @@ -3,10 +3,11 @@ #include #include +#include struct shadow_data { bool enabled; - float *color; + struct wlr_render_color color; float blur_sigma; }; -- cgit v1.2.3 From b392638c8a8d142376fa0f44b3cc0f3a6ebd93f3 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Wed, 3 Jan 2024 23:50:21 +0100 Subject: Fixed scaling issues --- include/render/pass.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/render/pass.h b/include/render/pass.h index ec38a73..05bf1e9 100644 --- a/include/render/pass.h +++ b/include/render/pass.h @@ -25,6 +25,7 @@ struct fx_gles_render_pass *fx_renderer_begin_buffer_pass(struct wlr_renderer *r struct fx_render_texture_options { struct wlr_render_texture_options base; + float scale; struct wlr_box *clip_box; // Used to clip csd. Ignored if NULL int corner_radius; }; @@ -34,6 +35,7 @@ struct fx_render_texture_options fx_render_texture_options_default( struct fx_render_rect_options { struct wlr_render_rect_options base; + float scale; }; struct fx_render_rect_options fx_render_rect_options_default( -- cgit v1.2.3 From ace97585b2b4d8cbb5ead6cd0f72fa8e8889c9d7 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Thu, 4 Jan 2024 02:10:25 +0100 Subject: Cleaned up/rebased meson.build files --- include/meson.build | 1 - 1 file changed, 1 deletion(-) delete mode 100644 include/meson.build (limited to 'include') diff --git a/include/meson.build b/include/meson.build deleted file mode 100644 index 4c388f0..0000000 --- a/include/meson.build +++ /dev/null @@ -1 +0,0 @@ -exclude_files = ['meson.build', 'config.h.in', 'version.h.in'] -- cgit v1.2.3