Merge branch 'fractional-render' into 'master'

render/pass: accept fractional destination coordinates

See merge request wlroots/wlroots!5208
This commit is contained in:
Loukas Agorgianitis 2026-02-03 22:40:33 +02:00
commit cefe5e9a32
22 changed files with 248 additions and 66 deletions

View file

@ -35,6 +35,7 @@ struct wlr_gles2_tex_shader {
GLint tex;
GLint alpha;
GLint pos_attrib;
GLint dst_bounds;
};
struct wlr_gles2_renderer {
@ -79,6 +80,7 @@ struct wlr_gles2_renderer {
GLint proj;
GLint color;
GLint pos_attrib;
GLint dst_bounds;
} quad;
struct wlr_gles2_tex_shader tex_rgba;
struct wlr_gles2_tex_shader tex_rgbx;

View file

@ -368,6 +368,13 @@ struct wlr_vk_frag_texture_pcr_data {
float matrix[4][4]; // only a 3x3 subset is used
float alpha;
float luminance_multiplier;
float _pad[2]; // padding for vec4 alignment
float dst_bounds[4]; // x, y, x+width, y+height
};
struct wlr_vk_frag_quad_pcr_data {
float color[4];
float dst_bounds[4]; // x, y, x+width, y+height
};
struct wlr_vk_frag_output_pcr_data {

View file

@ -4,6 +4,7 @@
#include <wayland-server-protocol.h>
struct wlr_box;
struct wlr_fbox;
/** Writes the identity matrix into mat */
void wlr_matrix_identity(float mat[static 9]);
@ -27,7 +28,7 @@ void wlr_matrix_transform(float mat[static 9],
* specified wlr_box onto a given orthographic projection with a given
* rotation. The result is written to mat, which can be applied to each
* coordinate of the box to get a new coordinate from [-1,1]. */
void wlr_matrix_project_box(float mat[static 9], const struct wlr_box *box,
void wlr_matrix_project_box(float mat[static 9], const struct wlr_fbox *box,
enum wl_output_transform transform, const float projection[static 9]);
/**

View file

@ -76,10 +76,10 @@ struct wlr_render_timer_impl {
void wlr_render_texture_options_get_src_box(const struct wlr_render_texture_options *options,
struct wlr_fbox *box);
void wlr_render_texture_options_get_dst_box(const struct wlr_render_texture_options *options,
struct wlr_box *box);
struct wlr_fbox *box);
float wlr_render_texture_options_get_alpha(const struct wlr_render_texture_options *options);
void wlr_render_rect_options_get_box(const struct wlr_render_rect_options *options,
const struct wlr_buffer *buffer, struct wlr_box *box);
const struct wlr_buffer *buffer, struct wlr_fbox *box);
void wlr_texture_read_pixels_options_get_src_box(
const struct wlr_texture_read_pixels_options *options,

View file

@ -90,7 +90,7 @@ struct wlr_render_texture_options {
/* Source coordinates, leave empty to render the whole texture */
struct wlr_fbox src_box;
/* Destination coordinates, width/height default to the texture size */
struct wlr_box dst_box;
struct wlr_fbox dst_box;
/* Opacity between 0 (transparent) and 1 (opaque), leave NULL for opaque */
const float *alpha;
/* Clip region, leave NULL to disable clipping */
@ -142,7 +142,7 @@ struct wlr_render_color {
struct wlr_render_rect_options {
/* Rectangle coordinates */
struct wlr_box box;
struct wlr_fbox box;
/* Source color */
struct wlr_render_color color;
/* Clip region, leave NULL to disable clipping */