Commit 0aa64fa4 authored by Paulo Warren's avatar Paulo Warren Committed by Commit Bot

gpu: Add SharedImage usage for video acceleration

This small CL introduces an addition to the SharedImageUsage enum:
SHARED_IMAGE_USAGE_VIDEO_ACCELERATION. It will be used
in the shared image factory to determine the correct type of factory
(interop_backing_factory) to be used in video decoding.

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

BUG=1058103
TEST=None

Change-Id: Ia2215aba5b786ab69327d922b7ffa7afda06f8b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103068
Commit-Queue: Paulo Warren <pwarren@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753294}
parent 226721a6
...@@ -35,9 +35,8 @@ enum SharedImageUsage : uint32_t { ...@@ -35,9 +35,8 @@ enum SharedImageUsage : uint32_t {
// TODO(crbug.com/969114): This usage is currently not supported in GL/Vulkan // TODO(crbug.com/969114): This usage is currently not supported in GL/Vulkan
// interop cases. // interop cases.
SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE = 1 << 9, SHARED_IMAGE_USAGE_CONCURRENT_READ_WRITE = 1 << 9,
// Image will be used in a platform specific API that requires a native buffer // Image will be used for video decode acceleration on Chrome OS.
// allocation. SHARED_IMAGE_USAGE_VIDEO_DECODE = 1 << 10,
SHARED_IMAGE_USAGE_NATIVE_BUFFER = 1 << 10,
}; };
} // namespace gpu } // namespace gpu
......
...@@ -386,7 +386,7 @@ SharedImageBackingFactory* SharedImageFactory::GetFactoryByUsage( ...@@ -386,7 +386,7 @@ SharedImageBackingFactory* SharedImageFactory::GetFactoryByUsage(
bool share_between_gl_vulkan = gl_usage && vulkan_usage; bool share_between_gl_vulkan = gl_usage && vulkan_usage;
bool using_interop_factory = share_between_gl_vulkan || using_dawn || bool using_interop_factory = share_between_gl_vulkan || using_dawn ||
share_between_gl_metal || share_between_gl_metal ||
(usage & SHARED_IMAGE_USAGE_NATIVE_BUFFER) || (usage & SHARED_IMAGE_USAGE_VIDEO_DECODE) ||
(share_between_threads && vulkan_usage); (share_between_threads && vulkan_usage);
// TODO(vasilyt): Android required AHB for overlays // 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