mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-06-13 14:32:57 -04:00
Merge branch 'render' into 'master'
render: general color_transform for wlr_render_pass_add_texture() See merge request wlroots/wlroots!5260
This commit is contained in:
commit
ed3c145f94
12 changed files with 544 additions and 151 deletions
|
|
@ -11,6 +11,7 @@ enum wlr_color_transform_type {
|
|||
COLOR_TRANSFORM_LUT_3X1D,
|
||||
COLOR_TRANSFORM_MATRIX,
|
||||
COLOR_TRANSFORM_PIPELINE,
|
||||
COLOR_TRANSFORM_EOTF,
|
||||
};
|
||||
|
||||
struct wlr_color_transform {
|
||||
|
|
@ -20,6 +21,12 @@ struct wlr_color_transform {
|
|||
enum wlr_color_transform_type type;
|
||||
};
|
||||
|
||||
struct wlr_color_transform_eotf {
|
||||
struct wlr_color_transform base;
|
||||
|
||||
enum wlr_color_transfer_function tf;
|
||||
};
|
||||
|
||||
struct wlr_color_transform_inverse_eotf {
|
||||
struct wlr_color_transform base;
|
||||
|
||||
|
|
@ -72,6 +79,13 @@ void color_transform_lcms2_finish(struct wlr_color_transform_lcms2 *tr);
|
|||
void color_transform_lcms2_eval(struct wlr_color_transform_lcms2 *tr,
|
||||
float out[static 3], const float in[static 3]);
|
||||
|
||||
/**
|
||||
* Gets a wlr_color_transform_eotf from a generic wlr_color_transform.
|
||||
* Asserts that the base type is COLOR_TRANSFORM_EOTF
|
||||
*/
|
||||
struct wlr_color_transform_eotf *wlr_color_transform_eotf_from_base(
|
||||
struct wlr_color_transform *tr);
|
||||
|
||||
/**
|
||||
* Gets a wlr_color_transform_inverse_eotf from a generic wlr_color_transform.
|
||||
* Asserts that the base type is COLOR_TRANSFORM_INVERSE_EOTF
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ enum wlr_vk_texture_transform {
|
|||
WLR_VK_TEXTURE_TRANSFORM_ST2084_PQ = 2,
|
||||
WLR_VK_TEXTURE_TRANSFORM_GAMMA22 = 3,
|
||||
WLR_VK_TEXTURE_TRANSFORM_BT1886 = 4,
|
||||
WLR_VK_TEXTURE_TRANSFORM_LUT_3D = 5,
|
||||
};
|
||||
|
||||
enum wlr_vk_shader_source {
|
||||
|
|
@ -284,8 +285,8 @@ struct wlr_vk_command_buffer {
|
|||
uint64_t timeline_point;
|
||||
// Textures to destroy after the command buffer completes
|
||||
struct wl_list destroy_textures; // wlr_vk_texture.destroy_link
|
||||
// Color transform to unref after the command buffer completes
|
||||
struct wlr_color_transform *color_transform;
|
||||
// Color transforms to unref after the command buffer completes
|
||||
struct wl_array color_transforms; // struct wlr_color_transform*
|
||||
|
||||
// For DMA-BUF implicit sync interop, may be NULL
|
||||
VkSemaphore binary_semaphore;
|
||||
|
|
@ -313,11 +314,12 @@ struct wlr_vk_renderer {
|
|||
// for blend->output subpass
|
||||
VkPipelineLayout output_pipe_layout;
|
||||
VkDescriptorSetLayout output_ds_srgb_layout;
|
||||
VkDescriptorSetLayout output_ds_lut3d_layout;
|
||||
VkSampler output_sampler_lut3d;
|
||||
|
||||
VkDescriptorSetLayout ds_lut3d_layout;
|
||||
VkSampler sampler_lut3d;
|
||||
// descriptor set indicating dummy 1x1x1 image, for use in the lut3d slot
|
||||
VkDescriptorSet output_ds_lut3d_dummy;
|
||||
struct wlr_vk_descriptor_pool *output_ds_lut3d_dummy_pool;
|
||||
VkDescriptorSet ds_lut3d_dummy;
|
||||
struct wlr_vk_descriptor_pool *ds_lut3d_dummy_pool;
|
||||
|
||||
size_t last_output_pool_size;
|
||||
struct wl_list output_descriptor_pools; // wlr_vk_descriptor_pool.link
|
||||
|
|
@ -372,7 +374,8 @@ struct wlr_vk_vert_pcr_data {
|
|||
struct wlr_vk_frag_texture_pcr_data {
|
||||
float matrix[4][4]; // only a 3x3 subset is used
|
||||
float alpha;
|
||||
float luminance_multiplier;
|
||||
float lut_3d_offset;
|
||||
float lut_3d_scale;
|
||||
};
|
||||
|
||||
struct wlr_vk_frag_output_pcr_data {
|
||||
|
|
@ -493,6 +496,8 @@ bool vulkan_wait_command_buffer(struct wlr_vk_command_buffer *cb,
|
|||
struct wlr_vk_renderer *renderer);
|
||||
VkSemaphore vulkan_command_buffer_wait_sync_file(struct wlr_vk_renderer *renderer,
|
||||
struct wlr_vk_command_buffer *render_cb, size_t sem_index, int sync_file_fd);
|
||||
bool vulkan_command_buffer_ref_color_transform(struct wlr_vk_command_buffer *cb,
|
||||
struct wlr_color_transform *color_transform);
|
||||
|
||||
bool vulkan_sync_render_pass_release(struct wlr_vk_renderer *renderer,
|
||||
struct wlr_vk_render_pass *pass);
|
||||
|
|
@ -602,7 +607,7 @@ struct wlr_vk_color_transform {
|
|||
} lut_3d;
|
||||
|
||||
float color_matrix[9];
|
||||
enum wlr_color_transfer_function inverse_eotf;
|
||||
enum wlr_color_transfer_function eotf;
|
||||
};
|
||||
void vk_color_transform_destroy(struct wlr_addon *addon);
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,13 @@ struct wlr_color_transform;
|
|||
struct wlr_color_transform *wlr_color_transform_init_linear_to_icc(
|
||||
const void *data, size_t size);
|
||||
|
||||
/**
|
||||
* Initialize a color transformation to apply EOTF decoding. Returns
|
||||
* NULL on failure.
|
||||
*/
|
||||
struct wlr_color_transform *wlr_color_transform_init_eotf_to_linear(
|
||||
enum wlr_color_transfer_function tf);
|
||||
|
||||
/**
|
||||
* Initialize a color transformation to apply EOTF⁻¹ encoding. Returns
|
||||
* NULL on failure.
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@ struct wlr_render_timer;
|
|||
struct wlr_buffer_pass_options {
|
||||
/* Timer to measure the duration of the render pass */
|
||||
struct wlr_render_timer *timer;
|
||||
/* Color transform to apply to the output of the render pass.
|
||||
* Leave NULL to indicate the default transform (Gamma 2.2 encoding for
|
||||
* sRGB monitors) */
|
||||
/* Color transform to apply to the output of the render pass */
|
||||
struct wlr_color_transform *color_transform;
|
||||
|
||||
/* Signal a timeline synchronization point when the render pass completes.
|
||||
|
|
@ -101,16 +99,12 @@ struct wlr_render_texture_options {
|
|||
enum wlr_scale_filter_mode filter_mode;
|
||||
/* Blend mode */
|
||||
enum wlr_render_blend_mode blend_mode;
|
||||
/* Transfer function the source texture is encoded with */
|
||||
enum wlr_color_transfer_function transfer_function;
|
||||
/* Primaries describing the color volume of the source texture */
|
||||
const struct wlr_color_primaries *primaries;
|
||||
/* Applied to convert from source texture to blend space */
|
||||
struct wlr_color_transform *color_transform;
|
||||
/* Color encoding of the source texture for YCbCr conversion to RGB */
|
||||
enum wlr_color_encoding color_encoding;
|
||||
/* Color range of the source texture */
|
||||
enum wlr_color_range color_range;
|
||||
/* Default: 1.0 */
|
||||
const float *luminance_multiplier;
|
||||
|
||||
/* Wait for a timeline synchronization point before texturing.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ struct wlr_output_cursor {
|
|||
|
||||
struct {
|
||||
struct wl_listener renderer_destroy;
|
||||
struct wlr_color_transform *color_transform;
|
||||
struct wlr_color_transform *color_transform_linearize;
|
||||
struct wlr_color_transform *color_transform_encode;
|
||||
} WLR_PRIVATE;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ struct wlr_scene {
|
|||
bool direct_scanout;
|
||||
bool calculate_visibility;
|
||||
bool highlight_transparent_region;
|
||||
|
||||
struct wlr_scene_color_transform_cache *color_transform_cache;
|
||||
} WLR_PRIVATE;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue