Hash :
193e9cda
Author :
Date :
2025-09-25T15:26:39
Revert "Vulkan: Simplify/Fix DmaBufImageSiblingVkLinux import probing" This reverts commit d917f77130e5194e82418f3bdaa2cd5b2af55c03. Reason for revert: Google Meet Regression https://crbug.com/445863166 Original change's description: > Vulkan: Simplify/Fix DmaBufImageSiblingVkLinux import probing > > Remove the multi-format probing logic in DmaBufImageSiblingVkLinux. > Use the renderer’s base VkFormat and a single check with > VkImageFormatListCreateInfo, instead of looping over mVkFormats with > mutable/non-mutable combinations. This cuts down redundant queries > and streamlines initImpl. > > Also, this CL fixes some issues occur when mapping DRM format into > Vulkan backend formats. > - Default to SampleOnly but prefer Renderable if the modifier properties > exposes both sampling and rendering, since usage at import time is > unknown. > - Fix emulated-format handling issue by using getIntendedFormatID() and > getActualImageFormatID() instead of deriving both IDs from VkFormat with > GetFormatIDFromVkFormat() directly. > > Bug: angleproject:442313595 > Bug: angleproject:426475684 > Change-Id: Ia38d8e7901da10948a2c15eb284b055359dd4a2d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6904888 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: mohan maiya <m.maiya@samsung.com> Bug: angleproject:442313595 Bug: angleproject:426475684 Bug: chromium:445863166 Change-Id: I530e9b363a2e25ec2325e3933a409d0aae9940c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6986844 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Yuxin Hu <yuxinhu@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DmaBufImageSiblingVkLinux.h: Defines the DmaBufImageSiblingVkLinux to wrap
// EGL images created from Linux dma-buf objects
#ifndef LIBANGLE_RENDERER_VULKAN_LINUX_DMABUFIMAGESIBLINGVKLINUX_H_
#define LIBANGLE_RENDERER_VULKAN_LINUX_DMABUFIMAGESIBLINGVKLINUX_H_
#include "libANGLE/renderer/vulkan/ImageVk.h"
namespace rx
{
enum MutableFormat
{
Allowed,
NotAllowed
};
enum InitResult
{
Success,
Failed
};
class DmaBufImageSiblingVkLinux : public ExternalImageSiblingVk
{
public:
DmaBufImageSiblingVkLinux(const egl::AttributeMap &attribs);
~DmaBufImageSiblingVkLinux() override;
egl::Error initialize(const egl::Display *display) override;
void onDestroy(const egl::Display *display) override;
// ExternalImageSiblingImpl interface
gl::Format getFormat() const override;
bool isRenderable(const gl::Context *context) const override;
bool isTexturable(const gl::Context *context) const override;
bool isYUV() const override;
bool hasProtectedContent() const override;
gl::Extents getSize() const override;
size_t getSamples() const override;
// ExternalImageSiblingVk interface
vk::ImageHelper *getImage() const override;
void release(vk::Renderer *renderer) override;
private:
angle::Result initWithFormat(DisplayVk *displayVk,
const angle::Format &format,
VkFormat vulkanFormat,
MutableFormat mutableFormat,
InitResult *outResult);
angle::Result initImpl(DisplayVk *displayVk);
egl::AttributeMap mAttribs;
gl::Extents mSize;
gl::Format mFormat;
std::vector<VkFormat> mVkFormats;
bool mRenderable;
bool mTextureable;
bool mYUV;
bool mHasProtectedContent;
size_t mSamples;
vk::ImageHelper *mImage;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_LINUX_DMABUFIMAGESIBLINGVKLINUX_H_