Implement EGLImage external texture API for GL.

Tests are based on the IOSurfaceWrappingTests.
Sampling tests are not implemented, since they would require
support for the samplerExternalOES sampler type in WGSL.

Bug: chromium:1205155
Change-Id: Icc114eaf6efaee93f1b8486e615f0fd307f23080
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50201
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Stephen White
2021-06-03 16:19:16 +00:00
committed by Dawn LUCI CQ
parent b3c371031c
commit b5652c75d2
9 changed files with 454 additions and 1 deletions

View File

@@ -215,6 +215,7 @@ namespace dawn_native {
DmaBuf,
IOSurface,
DXGISharedHandle,
EGLImage,
};
// Common properties of external images

View File

@@ -15,6 +15,8 @@
#ifndef DAWNNATIVE_OPENGLBACKEND_H_
#define DAWNNATIVE_OPENGLBACKEND_H_
typedef void* EGLImage;
#include <dawn/dawn_wsi.h>
#include <dawn_native/DawnNative.h>
@@ -38,6 +40,16 @@ namespace dawn_native { namespace opengl {
DAWN_NATIVE_EXPORT WGPUTextureFormat
GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain);
struct DAWN_NATIVE_EXPORT ExternalImageDescriptorEGLImage : ExternalImageDescriptor {
public:
ExternalImageDescriptorEGLImage();
::EGLImage image;
};
DAWN_NATIVE_EXPORT WGPUTexture
WrapExternalEGLImage(WGPUDevice device, const ExternalImageDescriptorEGLImage* descriptor);
}} // namespace dawn_native::opengl
#endif // DAWNNATIVE_OPENGLBACKEND_H_