mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-18 06:47:31 -04:00
wip: render/vulkan: add support for shm YCbCr textures
Need to update write_pixels.
This commit is contained in:
parent
63575a5d20
commit
6e4f2cc0f9
2 changed files with 11 additions and 4 deletions
|
|
@ -437,9 +437,13 @@ void vulkan_format_props_query(struct wlr_vk_device *dev,
|
|||
const struct wlr_pixel_format_info *format_info = drm_get_pixel_format_info(format->drm);
|
||||
|
||||
// non-dmabuf texture properties
|
||||
VkFormatFeatureFlags features = shm_tex_features;
|
||||
if (format->is_ycbcr) {
|
||||
features |= ycbcr_tex_features;
|
||||
}
|
||||
const char *shm_texture_status;
|
||||
if ((fmtp.formatProperties.optimalTilingFeatures & shm_tex_features) == shm_tex_features &&
|
||||
!format->is_ycbcr && format_info != NULL) {
|
||||
if ((fmtp.formatProperties.optimalTilingFeatures & features) == features &&
|
||||
format_info != NULL) {
|
||||
VkPhysicalDeviceImageFormatInfo2 fmti = {
|
||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
|
||||
.type = VK_IMAGE_TYPE_2D,
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ static struct wlr_texture *vulkan_texture_from_pixels(
|
|||
|
||||
const struct wlr_vk_format_props *fmt =
|
||||
vulkan_format_props_from_drm(renderer->dev, drm_fmt);
|
||||
if (fmt == NULL || fmt->format.is_ycbcr) {
|
||||
if (fmt == NULL) {
|
||||
char *format_name = drmGetFormatName(drm_fmt);
|
||||
wlr_log(WLR_ERROR, "Unsupported pixel format %s (0x%08"PRIX32")",
|
||||
format_name, drm_fmt);
|
||||
|
|
@ -360,7 +360,10 @@ static struct wlr_texture *vulkan_texture_from_pixels(
|
|||
}
|
||||
|
||||
texture->format = &fmt->format;
|
||||
texture->pipeline_layout = &renderer->default_pipeline_layout;
|
||||
texture->pipeline_layout = vulkan_get_pipeline_layout(renderer, texture->format);
|
||||
if (texture->pipeline_layout == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
VkImageCreateInfo img_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue