vulkan-renderer: rename output options to surface/surfaceless

The fbo naming inherited from gl-renderer is confusing, and now it
is used in many places.
Rename the two options for output creation to surface and surfaceless
to hopefully make them more meaningful.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
This commit is contained in:
Erico Nunes 2025-07-25 15:55:01 +02:00 committed by Daniel Stone
parent dfad00e8c4
commit aff309fa9f
9 changed files with 28 additions and 28 deletions

View file

@ -611,7 +611,7 @@ drm_output_init_vulkan(struct drm_output *output, struct drm_backend *b)
output->format,
fallback_format_for(output->format),
};
struct vulkan_renderer_output_options options = {
struct vulkan_renderer_surface_options options = {
.formats = format,
.formats_count = 1,
.area.x = 0,
@ -649,7 +649,7 @@ drm_output_init_vulkan(struct drm_output *output, struct drm_backend *b)
for (unsigned int i = 0; i < options.num_gbm_bos; i++)
options.gbm_bos[i] = output->gbm_bos[i];
if (renderer->vulkan->output_window_create(&output->base, &options) < 0) {
if (renderer->vulkan->output_surface_create(&output->base, &options) < 0) {
weston_log("failed to create vulkan renderer output state\n");
gbm_surface_destroy(output->gbm_surface);
output->gbm_surface = NULL;

View file

@ -338,7 +338,7 @@ headless_output_enable_vulkan(struct headless_output *output)
struct headless_backend *b = output->backend;
const struct weston_renderer *renderer = b->compositor->renderer;
const struct weston_mode *mode = output->base.current_mode;
struct vulkan_renderer_fbo_options options = { 0 };
struct vulkan_renderer_surfaceless_options options = { 0 };
if (b->decorate) {
/*
@ -366,7 +366,7 @@ headless_output_enable_vulkan(struct headless_output *output)
options.fb_size.height = mode->height;
}
if (renderer->vulkan->output_fbo_create(&output->base, &options) < 0) {
if (renderer->vulkan->output_surfaceless_create(&output->base, &options) < 0) {
weston_log("failed to create vulkan renderer output state\n");
if (output->frame) {
frame_destroy(output->frame);

View file

@ -366,12 +366,12 @@ pipewire_output_enable_vulkan(struct pipewire_output *output)
.width = fb_size.width,
.height = fb_size.height
};
const struct vulkan_renderer_fbo_options options = {
const struct vulkan_renderer_surfaceless_options options = {
.fb_size = fb_size,
.area = area,
};
return renderer->vulkan->output_fbo_create(&output->base, &options);
return renderer->vulkan->output_surfaceless_create(&output->base, &options);
}
static void

View file

@ -540,7 +540,7 @@ rdp_output_enable(struct weston_output *base)
break;
}
case WESTON_RENDERER_VULKAN: {
const struct vulkan_renderer_fbo_options options = {
const struct vulkan_renderer_surfaceless_options options = {
.area = {
.width = output->base.current_mode->width,
.height = output->base.current_mode->height,
@ -551,7 +551,7 @@ rdp_output_enable(struct weston_output *base)
},
};
if (renderer->vulkan->output_fbo_create(&output->base, &options) < 0) {
if (renderer->vulkan->output_surfaceless_create(&output->base, &options) < 0) {
return -1;
}
break;

View file

@ -846,7 +846,7 @@ vnc_output_enable(struct weston_output *base)
break;
}
case WESTON_RENDERER_VULKAN: {
const struct vulkan_renderer_fbo_options options = {
const struct vulkan_renderer_surfaceless_options options = {
.area = {
.width = output->base.current_mode->width,
.height = output->base.current_mode->height,
@ -856,7 +856,7 @@ vnc_output_enable(struct weston_output *base)
.height = output->base.current_mode->height,
},
};
if (renderer->vulkan->output_fbo_create(&output->base, &options) < 0)
if (renderer->vulkan->output_surfaceless_create(&output->base, &options) < 0)
return -1;
break;
}

View file

@ -814,7 +814,7 @@ wayland_output_init_vulkan_renderer(struct wayland_output *output)
const struct weston_mode *mode = output->base.current_mode;
struct wayland_backend *b = output->backend;
const struct weston_renderer *renderer;
struct vulkan_renderer_output_options options = {
struct vulkan_renderer_surface_options options = {
.formats = b->formats,
.formats_count = b->formats_count,
};
@ -838,7 +838,7 @@ wayland_output_init_vulkan_renderer(struct wayland_output *output)
renderer = output->base.compositor->renderer;
if (renderer->vulkan->output_window_create(&output->base, &options) < 0)
if (renderer->vulkan->output_surface_create(&output->base, &options) < 0)
goto cleanup_window;
return 0;

View file

@ -1151,7 +1151,7 @@ x11_output_enable(struct weston_output *base)
break;
}
case WESTON_RENDERER_VULKAN: {
struct vulkan_renderer_output_options options = {
struct vulkan_renderer_surface_options options = {
.formats = b->formats,
.formats_count = b->formats_count,
.area.x = 0,
@ -1166,7 +1166,7 @@ x11_output_enable(struct weston_output *base)
options.xcb_visualid = screen->root_visual;
options.xcb_window = output->window;
ret = renderer->vulkan->output_window_create(base, &options);
ret = renderer->vulkan->output_surface_create(base, &options);
if (ret < 0)
goto err;

View file

@ -3445,7 +3445,7 @@ create_dmabuf_image(struct vulkan_renderer *vr,
static int
vulkan_renderer_output_window_create_gbm(struct weston_output *output,
const struct vulkan_renderer_output_options *options)
const struct vulkan_renderer_surface_options *options)
{
struct weston_compositor *ec = output->compositor;
struct vulkan_output_state *vo = get_output_state(output);
@ -3496,7 +3496,7 @@ vulkan_renderer_output_window_create_gbm(struct weston_output *output,
static int
vulkan_renderer_output_window_create_swapchain(struct weston_output *output,
const struct vulkan_renderer_output_options *options)
const struct vulkan_renderer_surface_options *options)
{
struct weston_compositor *ec = output->compositor;
struct vulkan_renderer *vr = get_renderer(ec);
@ -3677,8 +3677,8 @@ create_renderpass(struct weston_output *output, VkFormat format, VkImageLayout a
}
static int
vulkan_renderer_output_window_create(struct weston_output *output,
const struct vulkan_renderer_output_options *options)
vulkan_renderer_output_surface_create(struct weston_output *output,
const struct vulkan_renderer_surface_options *options)
{
int ret;
const struct weston_size *fb_size = &options->fb_size;
@ -3721,8 +3721,8 @@ vulkan_renderer_output_window_create(struct weston_output *output,
}
static int
vulkan_renderer_output_fbo_create(struct weston_output *output,
const struct vulkan_renderer_fbo_options *options)
vulkan_renderer_output_surfaceless_create(struct weston_output *output,
const struct vulkan_renderer_surfaceless_options *options)
{
/* TODO: a format is needed here because right now a renderpass object
* is created per output.
@ -4518,8 +4518,8 @@ vulkan_renderer_display_create(struct weston_compositor *ec,
WL_EXPORT struct vulkan_renderer_interface vulkan_renderer_interface = {
.display_create = vulkan_renderer_display_create,
.output_window_create = vulkan_renderer_output_window_create,
.output_fbo_create = vulkan_renderer_output_fbo_create,
.output_surface_create = vulkan_renderer_output_surface_create,
.output_surfaceless_create = vulkan_renderer_output_surfaceless_create,
.output_destroy = vulkan_renderer_output_destroy,
.create_fence_fd = vulkan_renderer_create_fence_fd,
};

View file

@ -57,7 +57,7 @@ struct vulkan_renderer_display_options {
#define NUM_GBM_BOS 2
struct vulkan_renderer_output_options {
struct vulkan_renderer_surface_options {
struct gbm_bo *gbm_bos[NUM_GBM_BOS];
unsigned int num_gbm_bos;
struct weston_size fb_size;
@ -75,7 +75,7 @@ struct vulkan_renderer_output_options {
void *wayland_surface;
};
struct vulkan_renderer_fbo_options {
struct vulkan_renderer_surfaceless_options {
/** Size of the framebuffer in pixels, including borders */
struct weston_size fb_size;
/** Area inside the framebuffer in pixels for composited content */
@ -86,11 +86,11 @@ struct vulkan_renderer_interface {
int (*display_create)(struct weston_compositor *ec,
const struct vulkan_renderer_display_options *options);
int (*output_window_create)(struct weston_output *output,
const struct vulkan_renderer_output_options *options);
int (*output_surface_create)(struct weston_output *output,
const struct vulkan_renderer_surface_options *options);
int (*output_fbo_create)(struct weston_output *output,
const struct vulkan_renderer_fbo_options *options);
int (*output_surfaceless_create)(struct weston_output *output,
const struct vulkan_renderer_surfaceless_options *options);
void (*output_destroy)(struct weston_output *output);