mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
render/vulkan: Guard hostmem import with env flag
Direct host memory import is experimental. Put it behind an environment variable to allow easy testing.
This commit is contained in:
parent
b385af41dc
commit
dfbb819044
4 changed files with 11 additions and 1 deletions
|
|
@ -49,6 +49,10 @@ wlroots reads these environment variables
|
||||||
* *WLR_RENDERER_ALLOW_SOFTWARE*: allows the gles2 renderer to use software
|
* *WLR_RENDERER_ALLOW_SOFTWARE*: allows the gles2 renderer to use software
|
||||||
rendering
|
rendering
|
||||||
|
|
||||||
|
## Vulkan renderer
|
||||||
|
|
||||||
|
* *WLR_VK_DIRECT_SHM_IMPORT*: Allow importing shm buffers directly as host memory
|
||||||
|
|
||||||
## scenes
|
## scenes
|
||||||
|
|
||||||
* *WLR_SCENE_DEBUG_DAMAGE*: specifies debug options for screen damage related
|
* *WLR_SCENE_DEBUG_DAMAGE*: specifies debug options for screen damage related
|
||||||
|
|
|
||||||
|
|
@ -324,6 +324,8 @@ struct wlr_vk_renderer {
|
||||||
VkImage dst_image;
|
VkImage dst_image;
|
||||||
VkDeviceMemory dst_img_memory;
|
VkDeviceMemory dst_img_memory;
|
||||||
} read_pixels_cache;
|
} read_pixels_cache;
|
||||||
|
|
||||||
|
bool direct_shm_import;
|
||||||
};
|
};
|
||||||
|
|
||||||
// vertex shader push constant range data
|
// vertex shader push constant range data
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#include "render/vulkan/shaders/output.frag.h"
|
#include "render/vulkan/shaders/output.frag.h"
|
||||||
#include "types/wlr_buffer.h"
|
#include "types/wlr_buffer.h"
|
||||||
#include "types/wlr_matrix.h"
|
#include "types/wlr_matrix.h"
|
||||||
|
#include "util/env.h"
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// - simplify stage allocation, don't track allocations but use ringbuffer-like
|
// - simplify stage allocation, don't track allocations but use ringbuffer-like
|
||||||
|
|
@ -2417,6 +2418,8 @@ struct wlr_renderer *vulkan_renderer_create_for_device(struct wlr_vk_device *dev
|
||||||
wl_list_init(&renderer->color_transforms);
|
wl_list_init(&renderer->color_transforms);
|
||||||
wl_list_init(&renderer->pipeline_layouts);
|
wl_list_init(&renderer->pipeline_layouts);
|
||||||
|
|
||||||
|
renderer->direct_shm_import = env_parse_bool("WLR_VK_DIRECT_SHM_IMPORT");
|
||||||
|
|
||||||
if (!init_static_render_data(renderer)) {
|
if (!init_static_render_data(renderer)) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,8 @@ static struct wlr_texture *vulkan_texture_from_pixels(
|
||||||
img_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
img_info.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderer->dev->api.vkGetMemoryHostPointerPropertiesEXT) {
|
if (renderer->direct_shm_import &&
|
||||||
|
renderer->dev->api.vkGetMemoryHostPointerPropertiesEXT) {
|
||||||
img_info.tiling = VK_IMAGE_TILING_LINEAR;
|
img_info.tiling = VK_IMAGE_TILING_LINEAR;
|
||||||
img_info.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
|
img_info.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue