mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
render: log error when requested renderer is compile-time disabled
It can be a bit confusing to debug when the user requests an explicit renderer but it's disabled at build-time. Log an error when that happens.
This commit is contained in:
parent
86c30b8715
commit
db7751f39e
1 changed files with 9 additions and 10 deletions
|
@ -366,12 +366,8 @@ static bool has_render_node(struct wlr_backend *backend) {
|
||||||
static struct wlr_renderer *renderer_autocreate(struct wlr_backend *backend, int drm_fd) {
|
static struct wlr_renderer *renderer_autocreate(struct wlr_backend *backend, int drm_fd) {
|
||||||
const char *renderer_options[] = {
|
const char *renderer_options[] = {
|
||||||
"auto",
|
"auto",
|
||||||
#if WLR_HAS_GLES2_RENDERER
|
|
||||||
"gles2",
|
"gles2",
|
||||||
#endif
|
|
||||||
#if WLR_HAS_VULKAN_RENDERER
|
|
||||||
"vulkan",
|
"vulkan",
|
||||||
#endif
|
|
||||||
"pixman",
|
"pixman",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -381,14 +377,16 @@ static struct wlr_renderer *renderer_autocreate(struct wlr_backend *backend, int
|
||||||
struct wlr_renderer *renderer = NULL;
|
struct wlr_renderer *renderer = NULL;
|
||||||
|
|
||||||
bool own_drm_fd = false;
|
bool own_drm_fd = false;
|
||||||
(void)open_preferred_drm_fd;
|
|
||||||
|
|
||||||
#if WLR_HAS_GLES2_RENDERER
|
if ((is_auto && WLR_HAS_GLES2_RENDERER) || strcmp(renderer_name, "gles2") == 0) {
|
||||||
if (is_auto || strcmp(renderer_name, "gles2") == 0) {
|
|
||||||
if (!open_preferred_drm_fd(backend, &drm_fd, &own_drm_fd)) {
|
if (!open_preferred_drm_fd(backend, &drm_fd, &own_drm_fd)) {
|
||||||
log_creation_failure(is_auto, "Cannot create GLES2 renderer: no DRM FD available");
|
log_creation_failure(is_auto, "Cannot create GLES2 renderer: no DRM FD available");
|
||||||
} else {
|
} else {
|
||||||
|
#if WLR_HAS_GLES2_RENDERER
|
||||||
renderer = wlr_gles2_renderer_create_with_drm_fd(drm_fd);
|
renderer = wlr_gles2_renderer_create_with_drm_fd(drm_fd);
|
||||||
|
#else
|
||||||
|
wlr_log(WLR_ERROR, "Cannot create GLES renderer: disabled at compile-time");
|
||||||
|
#endif
|
||||||
if (renderer) {
|
if (renderer) {
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
|
@ -396,14 +394,16 @@ static struct wlr_renderer *renderer_autocreate(struct wlr_backend *backend, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if WLR_HAS_VULKAN_RENDERER
|
|
||||||
if (strcmp(renderer_name, "vulkan") == 0) {
|
if (strcmp(renderer_name, "vulkan") == 0) {
|
||||||
if (!open_preferred_drm_fd(backend, &drm_fd, &own_drm_fd)) {
|
if (!open_preferred_drm_fd(backend, &drm_fd, &own_drm_fd)) {
|
||||||
log_creation_failure(is_auto, "Cannot create Vulkan renderer: no DRM FD available");
|
log_creation_failure(is_auto, "Cannot create Vulkan renderer: no DRM FD available");
|
||||||
} else {
|
} else {
|
||||||
|
#if WLR_HAS_VULKAN_RENDERER
|
||||||
renderer = wlr_vk_renderer_create_with_drm_fd(drm_fd);
|
renderer = wlr_vk_renderer_create_with_drm_fd(drm_fd);
|
||||||
|
#else
|
||||||
|
wlr_log(WLR_ERROR, "Cannot create Vulkan renderer: disabled at compile-time");
|
||||||
|
#endif
|
||||||
if (renderer) {
|
if (renderer) {
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
|
@ -411,7 +411,6 @@ static struct wlr_renderer *renderer_autocreate(struct wlr_backend *backend, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((is_auto && !has_render_node(backend)) || strcmp(renderer_name, "pixman") == 0) {
|
if ((is_auto && !has_render_node(backend)) || strcmp(renderer_name, "pixman") == 0) {
|
||||||
renderer = wlr_pixman_renderer_create();
|
renderer = wlr_pixman_renderer_create();
|
||||||
|
|
Loading…
Reference in a new issue