render: unify render pass accessors

Introduce helper functions to retrieve backend-specific render passes
from struct wlr_render_pass and replace ad-hoc internal accessors.
This commit is contained in:
YaoBing Xiao 2026-03-23 21:04:32 +08:00
parent d8d61ffd49
commit fce738d78d
11 changed files with 135 additions and 99 deletions

View file

@ -1844,6 +1844,14 @@ static bool pipeline_key_equals(const struct wlr_vk_pipeline_key *a,
return true;
}
struct wlr_vk_renderer *wlr_vk_renderer_from_renderer(
struct wlr_renderer *wlr_renderer) {
assert(wlr_renderer->impl == &renderer_impl);
struct wlr_vk_renderer *renderer = wl_container_of(wlr_renderer, renderer, wlr_renderer);
return renderer;
}
// Initializes the pipeline for rendering textures and using the given
// VkRenderPass and VkPipelineLayout.
struct wlr_vk_pipeline *setup_get_or_create_pipeline(