Skip to content

Commit

Permalink
rendervulkan: replace wlr legacy renderer impl with render pass
Browse files Browse the repository at this point in the history
Reduce boilerplate a bit, and should be compatible with both last
wlroots release and upcoming one.
  • Loading branch information
emersion committed Nov 23, 2023
1 parent 4a067fb commit 2d2d4ea
Showing 1 changed file with 6 additions and 36 deletions.
42 changes: 6 additions & 36 deletions src/rendervulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3893,36 +3893,6 @@ static uint32_t renderer_get_render_buffer_caps( struct wlr_renderer *renderer )
return 0;
}

static bool renderer_begin( struct wlr_renderer *renderer, uint32_t width, uint32_t height )
{
abort(); // unreachable
}

static void renderer_end( struct wlr_renderer *renderer )
{
abort(); // unreachable
}

static void renderer_clear( struct wlr_renderer *renderer, const float color[4] )
{
abort(); // unreachable
}

static void renderer_scissor( struct wlr_renderer *renderer, struct wlr_box *box )
{
abort(); // unreachable
}

static bool renderer_render_subtexture_with_matrix( struct wlr_renderer *renderer, struct wlr_texture *texture, const struct wlr_fbox *box, const float matrix[9], float alpha )
{
abort(); // unreachable
}

static void renderer_render_quad_with_matrix( struct wlr_renderer *renderer, const float color[4], const float matrix[9] )
{
abort(); // unreachable
}

static const uint32_t *renderer_get_shm_texture_formats( struct wlr_renderer *wlr_renderer, size_t *len
)
{
Expand Down Expand Up @@ -3950,18 +3920,18 @@ static struct wlr_texture *renderer_texture_from_buffer( struct wlr_renderer *wl
return &tex->base;
}

static struct wlr_render_pass *renderer_begin_buffer_pass( struct wlr_renderer *renderer, struct wlr_buffer *buffer, const struct wlr_buffer_pass_options *options )
{
abort(); // unreachable
}

static const struct wlr_renderer_impl renderer_impl = {
.begin = renderer_begin,
.end = renderer_end,
.clear = renderer_clear,
.scissor = renderer_scissor,
.render_subtexture_with_matrix = renderer_render_subtexture_with_matrix,
.render_quad_with_matrix = renderer_render_quad_with_matrix,
.get_shm_texture_formats = renderer_get_shm_texture_formats,
.get_dmabuf_texture_formats = renderer_get_dmabuf_texture_formats,
.get_drm_fd = renderer_get_drm_fd,
.get_render_buffer_caps = renderer_get_render_buffer_caps,
.texture_from_buffer = renderer_texture_from_buffer,
.begin_buffer_pass = renderer_begin_buffer_pass,
};

struct wlr_renderer *vulkan_renderer_create( void )
Expand Down

0 comments on commit 2d2d4ea

Please sign in to comment.