Commit 9bcfa0c8 authored by Paulo Warren's avatar Paulo Warren Committed by Commit Bot

gpu: Add SharedImage usage for native buffers

This small CL introduces an addition to the SharedImageUsage enum:
SHARED_IMAGE_USAGE_NATIVE_BUFFER. It will be used
in the shared image factory to determine the correct type of factory
(interop_backing_factory) to be used for platform specific tasks such
as VA-API decoding on Chrome OS.

The goal of this new usage is that on Chrome OS, a SharedImage created
using SHARED_IMAGE_USAGE_NATIVE_BUFFER should have an underlying
buffer and representations suitable for working with a video
acceleration API. In the case of VA-API, this means the underlying
buffer should be a NativePixmap.

Separate CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2083662

BUG=1058103
TEST=None

Change-Id: I7159163b5cc276f9ea4f6d5a6c0835b66bd72c89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089951
Commit-Queue: Paulo Warren <pwarren@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749197}
parent c746d540
......@@ -35,6 +35,9 @@ enum SharedImageUsage : uint32_t {
// TODO(crbug.com/969114): This usage is currently not supported in GL/Vulkan
// interop cases.
SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE = 1 << 9,
// Image will be used in a platform specific API that requires a native buffer
// allocation.
SHARED_IMAGE_USAGE_NATIVE_BUFFER = 1 << 10,
};
} // namespace gpu
......
......@@ -386,6 +386,7 @@ SharedImageBackingFactory* SharedImageFactory::GetFactoryByUsage(
bool share_between_gl_vulkan = gl_usage && vulkan_usage;
bool using_interop_factory = share_between_gl_vulkan || using_dawn ||
share_between_gl_metal ||
(usage & SHARED_IMAGE_USAGE_NATIVE_BUFFER) ||
(share_between_threads && vulkan_usage);
// TODO(vasilyt): Android required AHB for overlays
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment