Commit 3dddccff by Jeff Gilbert Committed by Commit Bot

Support RGB gl-tex-external stream consumers for StreamProducerNV12.

This makes it relatively simple to sample from a D3D11Texture of arbitrary format. From: https://bugzilla.mozilla.org/show_bug.cgi?id=1322746 BUG=angleproject:2233 TEST=angle_end2end_tests Change-Id: I10cd3043b5cb0c5d36dd613467ba6c0ceadf41af Reviewed-on: https://chromium-review.googlesource.com/758042 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 614dd0f5
Name
ANGLE_stream_producer_d3d_texture_nv12
ANGLE_stream_producer_d3d_texture
Name Strings
EGL_ANGLE_stream_producer_d3d_texture_nv12
EGL_ANGLE_stream_producer_d3d_texture
Contributors
Ian Ewell
Geoff Lang
John Bauman
Jeff Gilbert
Contacts
......@@ -22,7 +23,7 @@ Status
Version
Version 1, April 6, 2016
Version 2, November 15, 2017
Number
......@@ -30,34 +31,36 @@ Number
Dependencies
Requires EGL 1.5.
Requires EGL 1.4.
Requires OpenGL ES 2.0.
Requires the EGL_KHR_stream extension.
Requires the EGL_NV_stream_consumer_gltexture_yuv extension.
Requires the EGL_KHR_stream_consumer_gltexture extension.
Requires the EGL_ANGLE_device_d3d extension.
Overview
This extension allows D3D11 NV12 textures to be inserted into an EGL stream
with the expectation that the stream consumer will be a YUV GL texture
consumer using a two plane configuration (i.e. a Y plane and a UV plane).
This extension allows D3D11 textures to be inserted into an EGL stream
with the expectation that the stream consumer will be either an RGB GL
texture consumer, or a YUV GL texture consumer using a two plane
configuration (i.e. a Y plane and a UV plane).
This will act as the producer of the stream.
New procedures and functions
EGLBoolean eglCreateStreamProducerD3DTextureNV12ANGLE
(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
EGLBoolean eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
EGLBoolean eglCreateStreamProducerD3DTextureANGLE(
EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
EGLBoolean eglStreamPostD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
New Tokens
Accepted as an <attribute> in eglStreamPostD3DTextureNV12ANGLE:
Accepted as an <attribute> in eglStreamPostD3DTextureANGLE:
EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB
......@@ -68,25 +71,24 @@ EGL_KHR_stream extension with this:
Call
EGLBoolean eglCreateStreamProducerD3DTextureNV12ANGLE(
EGLBoolean eglCreateStreamProducerD3DTextureANGLE(
EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
to create a producer that accepts D3D11 NV12 textures and connect it as the
to create a producer that accepts D3D11 textures and connect it as the
producer of <stream>. <attrib_list> is used to specify attributes for the
stream producer. Currently there are no attributes to specify, and the
attribute list is used as a placeholder for future additions.
On failure, eglCreateStreamProducerD3DTextureNV12ANGLE returns EGL_FALSE and
On failure, eglCreateStreamProducerD3DTextureANGLE returns EGL_FALSE and
generates an error.
- EGL_BAD_STATE_KHR is generated if <stream> is not in the state
EGL_STREAM_STATE_CONNECTING_KHR.
- EGL_BAD_MATCH is generated if <stream> does not have a connected GL
texture YUV consumer that is configured to bind to two OpenGL
textures: one for the Y plane and one for the UV plane.
texture consumer.
- EGL_BAD_STREAM_KHR is generated if <stream> is not a valid EGLStream
generated for <dpy>.
......@@ -98,16 +100,16 @@ Add a section preceding "3.9.3 Posting Semantics" in the EGL specification:
3.9.x Posting to a Stream
To post a D3D11 NV12 texture to a stream, call
To post a D3D11 texture to a stream, call
EGLBoolean eglStreamPostD3DTextureNV12ANGLE(
EGLBoolean eglStreamPostD3DTextureANGLE(
EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list);
If <stream> is an appropriately configured stream and <texture> points to a
valid ID3D11Texture2D object of the format DXGI_FORMAT_NV12 that is owned
valid ID3D11Texture2D object of a supported format that is owned
by the same ID3D11Device that is queried with the EGL_ANGLE_device_d3d
extension, the texture will be posted to the stream and can be bound as one
or more OpenGL texture objects.
......@@ -129,7 +131,7 @@ Add a section preceding "3.9.3 Posting Semantics" in the EGL specification:
insertion is successful and will release the texture object when a new frame
is inserted or when the stream is destroyed.
On failure, eglStreamInsertD3DTextureNV12 returns EGL_FALSE and generates an
On failure, eglStreamInsertD3DTexture returns EGL_FALSE and generates an
error.
- EGL_BAD_STATE is generated if <stream> is not in the state
......@@ -137,11 +139,11 @@ Add a section preceding "3.9.3 Posting Semantics" in the EGL specification:
or EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR.
- EGL_BAD_MATCH is generated if the stream is not associated with a
D3D11 NV12 texture producer.
D3D11 texture producer.
- EGL_BAD_PARAMETER is generated if <texture> is not owned by the
queried device, is not in the format DXGI_FORMAT_NV12, is not
compatible with the implementation, or if the specified value for
queried device, is not a supported format, is not compatible with the
implementation, or if the specified value for
EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE is not a valid subresource id for
the texture.
......@@ -153,4 +155,11 @@ Add a section preceding "3.9.3 Posting Semantics" in the EGL specification:
Revision History
#1 (April 6, 2016) Ian Ewell
- initial draft
\ No newline at end of file
- initial draft
#2 (November 15, 2017) Jeff Gilbert
- Rename from EGL_ANGLE_stream_producer_d3d_texture_nv12 to
EGL_ANGLE_stream_producer_d3d_texture
- Remove NV12 suffix from function names
- add RGB GL texture consumer support
- reduce required EGL version to 1.4 (from 1.5)
......@@ -105,16 +105,16 @@
#define EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE 0x33AA
#endif /* EGL_ANGLE_experimental_present_path */
#ifndef EGL_ANGLE_stream_producer_d3d_texture_nv12
#define EGL_ANGLE_stream_producer_d3d_texture_nv12
#ifndef EGL_ANGLE_stream_producer_d3d_texture
#define EGL_ANGLE_stream_producer_d3d_texture
#define EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB
typedef EGLBoolean(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERD3DTEXTURENV12ANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMPOSTD3DTEXTURENV12ANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
typedef EGLBoolean(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureANGLE(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureANGLE(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
#endif
#endif /* EGL_ANGLE_stream_producer_d3d_texture_nv12 */
#endif /* EGL_ANGLE_stream_producer_d3d_texture */
#ifndef EGL_ANGLE_create_context_webgl_compatibility
#define EGL_ANGLE_create_context_webgl_compatibility 1
......
......@@ -1141,7 +1141,7 @@ DisplayExtensions::DisplayExtensions()
stream(false),
streamConsumerGLTexture(false),
streamConsumerGLTextureYUV(false),
streamProducerD3DTextureNV12(false),
streamProducerD3DTexture(false),
createContextWebGLCompatibility(false),
createContextBindGeneratesResource(false),
getSyncValues(false),
......@@ -1185,7 +1185,7 @@ std::vector<std::string> DisplayExtensions::getStrings() const
InsertExtensionString("EGL_KHR_stream_consumer_gltexture", streamConsumerGLTexture, &extensionStrings);
InsertExtensionString("EGL_NV_stream_consumer_gltexture_yuv", streamConsumerGLTextureYUV, &extensionStrings);
InsertExtensionString("EGL_ANGLE_flexible_surface_compatibility", flexibleSurfaceCompatibility, &extensionStrings);
InsertExtensionString("EGL_ANGLE_stream_producer_d3d_texture_nv12", streamProducerD3DTextureNV12, &extensionStrings);
InsertExtensionString("EGL_ANGLE_stream_producer_d3d_texture", streamProducerD3DTexture, &extensionStrings);
InsertExtensionString("EGL_ANGLE_create_context_webgl_compatibility", createContextWebGLCompatibility, &extensionStrings);
InsertExtensionString("EGL_CHROMIUM_create_context_bind_generates_resource", createContextBindGeneratesResource, &extensionStrings);
InsertExtensionString("EGL_CHROMIUM_sync_control", getSyncValues, &extensionStrings);
......
......@@ -678,8 +678,8 @@ struct DisplayExtensions
// EGL_NV_stream_consumer_gltexture_yuv
bool streamConsumerGLTextureYUV;
// EGL_ANGLE_stream_producer_d3d_texture_nv12
bool streamProducerD3DTextureNV12;
// EGL_ANGLE_stream_producer_d3d_texture
bool streamProducerD3DTexture;
// EGL_ANGLE_create_context_webgl_compatibility
bool createContextWebGLCompatibility;
......
......@@ -160,16 +160,16 @@ Error Stream::createConsumerGLTextureExternal(const AttributeMap &attributes, gl
return NoError();
}
Error Stream::createProducerD3D11TextureNV12(const AttributeMap &attributes)
Error Stream::createProducerD3D11Texture(const AttributeMap &attributes)
{
ASSERT(mState == EGL_STREAM_STATE_CONNECTING_KHR);
ASSERT(mConsumerType == ConsumerType::GLTextureYUV);
ASSERT(mConsumerType == ConsumerType::GLTextureRGB ||
mConsumerType == ConsumerType::GLTextureYUV);
ASSERT(mProducerType == ProducerType::NoProducer);
ASSERT(mPlaneCount == 2);
mProducerImplementation = mDisplay->getImplementation()->createStreamProducerD3DTextureNV12(
mConsumerType, attributes);
mProducerType = ProducerType::D3D11TextureNV12;
mProducerImplementation =
mDisplay->getImplementation()->createStreamProducerD3DTexture(mConsumerType, attributes);
mProducerType = ProducerType::D3D11Texture;
mState = EGL_STREAM_STATE_EMPTY_KHR;
return NoError();
......@@ -182,7 +182,7 @@ Error Stream::consumerAcquire(const gl::Context *context)
mState == EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR);
ASSERT(mConsumerType == ConsumerType::GLTextureRGB ||
mConsumerType == ConsumerType::GLTextureYUV);
ASSERT(mProducerType == ProducerType::D3D11TextureNV12);
ASSERT(mProducerType == ProducerType::D3D11Texture);
mState = EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR;
mConsumerFrame++;
......@@ -206,7 +206,7 @@ Error Stream::consumerRelease(const gl::Context *context)
mState == EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR);
ASSERT(mConsumerType == ConsumerType::GLTextureRGB ||
mConsumerType == ConsumerType::GLTextureYUV);
ASSERT(mProducerType == ProducerType::D3D11TextureNV12);
ASSERT(mProducerType == ProducerType::D3D11Texture);
// Release the images
for (int i = 0; i < mPlaneCount; i++)
......@@ -226,23 +226,23 @@ bool Stream::isConsumerBoundToContext(const gl::Context *context) const
return (context == mContext);
}
Error Stream::validateD3D11NV12Texture(void *texture) const
Error Stream::validateD3D11Texture(void *texture, const AttributeMap &attributes) const
{
ASSERT(mConsumerType == ConsumerType::GLTextureRGB ||
mConsumerType == ConsumerType::GLTextureYUV);
ASSERT(mProducerType == ProducerType::D3D11TextureNV12);
ASSERT(mProducerType == ProducerType::D3D11Texture);
ASSERT(mProducerImplementation != nullptr);
return mProducerImplementation->validateD3DNV12Texture(texture);
return mProducerImplementation->validateD3DTexture(texture, attributes);
}
Error Stream::postD3D11NV12Texture(void *texture, const AttributeMap &attributes)
Error Stream::postD3D11Texture(void *texture, const AttributeMap &attributes)
{
ASSERT(mConsumerType == ConsumerType::GLTextureRGB ||
mConsumerType == ConsumerType::GLTextureYUV);
ASSERT(mProducerType == ProducerType::D3D11TextureNV12);
ASSERT(mProducerType == ProducerType::D3D11Texture);
mProducerImplementation->postD3DNV12Texture(texture, attributes);
mProducerImplementation->postD3DTexture(texture, attributes);
mProducerFrame++;
mState = EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR;
......
......@@ -51,7 +51,7 @@ class Stream final : angle::NonCopyable
enum class ProducerType
{
NoProducer,
D3D11TextureNV12,
D3D11Texture,
};
// A GL texture interpretation of a part of a producer frame. For use with GL texture consumers
......@@ -85,7 +85,7 @@ class Stream final : angle::NonCopyable
Error createConsumerGLTextureExternal(const AttributeMap &attributes, gl::Context *context);
// Producer creation methods
Error createProducerD3D11TextureNV12(const AttributeMap &attributes);
Error createProducerD3D11Texture(const AttributeMap &attributes);
// Consumer methods
Error consumerAcquire(const gl::Context *context);
......@@ -96,8 +96,8 @@ class Stream final : angle::NonCopyable
bool isConsumerBoundToContext(const gl::Context *context) const;
// Producer methods
Error validateD3D11NV12Texture(void *texture) const;
Error postD3D11NV12Texture(void *texture, const AttributeMap &attributes);
Error validateD3D11Texture(void *texture, const AttributeMap &attributes) const;
Error postD3D11Texture(void *texture, const AttributeMap &attributes);
private:
// Associated display
......
......@@ -58,7 +58,7 @@ class EGLImplFactory : angle::NonCopyable
virtual ContextImpl *createContext(const gl::ContextState &state) = 0;
virtual StreamProducerImpl *createStreamProducerD3DTextureNV12(
virtual StreamProducerImpl *createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) = 0;
};
......
......@@ -23,11 +23,12 @@ class StreamProducerImpl : angle::NonCopyable
// Validates the ability for the producer to accept an arbitrary pointer to a frame. All
// pointers should be validated through this function before being used to produce a frame.
virtual egl::Error validateD3DNV12Texture(void *pointer) const = 0;
virtual egl::Error validateD3DTexture(void *pointer,
const egl::AttributeMap &attributes) const = 0;
// Constructs a frame from an arbitrary external pointer that points to producer specific frame
// data. Replaces the internal frame with the new one.
virtual void postD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) = 0;
virtual void postD3DTexture(void *pointer, const egl::AttributeMap &attributes) = 0;
// Returns an OpenGL texture interpretation of some frame attributes for the purpose of
// constructing an OpenGL texture from a frame. Depending on the producer and consumer, some
......
......@@ -206,12 +206,12 @@ ContextImpl *DisplayD3D::createContext(const gl::ContextState &state)
return mRenderer->createContext(state);
}
StreamProducerImpl *DisplayD3D::createStreamProducerD3DTextureNV12(
StreamProducerImpl *DisplayD3D::createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs)
{
ASSERT(mRenderer != nullptr);
return mRenderer->createStreamProducerD3DTextureNV12(consumerType, attribs);
return mRenderer->createStreamProducerD3DTexture(consumerType, attribs);
}
egl::Error DisplayD3D::makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context)
......
......@@ -44,9 +44,8 @@ class DisplayD3D : public DisplayImpl
ContextImpl *createContext(const gl::ContextState &state) override;
StreamProducerImpl *createStreamProducerD3DTextureNV12(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
egl::Error makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context) override;
......
......@@ -283,7 +283,7 @@ class RendererD3D : public BufferFactoryD3D, public MultisampleTextureInitialize
bool presentPathFastEnabled() const { return mPresentPathFastEnabled; }
// Stream creation
virtual StreamProducerImpl *createStreamProducerD3DTextureNV12(
virtual StreamProducerImpl *createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) = 0;
......
......@@ -47,7 +47,7 @@
#include "libANGLE/renderer/d3d/d3d11/Query11.h"
#include "libANGLE/renderer/d3d/d3d11/RenderTarget11.h"
#include "libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h"
#include "libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h"
#include "libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.h"
#include "libANGLE/renderer/d3d/d3d11/SwapChain11.h"
#include "libANGLE/renderer/d3d/d3d11/TextureStorage11.h"
#include "libANGLE/renderer/d3d/d3d11/TransformFeedback11.h"
......@@ -1204,11 +1204,7 @@ void Renderer11::generateDisplayExtensions(egl::DisplayExtensions *outExtensions
outExtensions->stream = true;
outExtensions->streamConsumerGLTexture = true;
outExtensions->streamConsumerGLTextureYUV = true;
// Not all D3D11 devices support NV12 textures
if (getNV12TextureSupport())
{
outExtensions->streamProducerD3DTextureNV12 = true;
}
outExtensions->streamProducerD3DTexture = true;
outExtensions->flexibleSurfaceCompatibility = true;
outExtensions->directComposition = !!mDCompModule;
......@@ -2305,18 +2301,6 @@ bool Renderer11::getShareHandleSupport() const
return true;
}
bool Renderer11::getNV12TextureSupport() const
{
HRESULT result;
UINT formatSupport;
result = mDevice->CheckFormatSupport(DXGI_FORMAT_NV12, &formatSupport);
if (result == E_FAIL)
{
return false;
}
return (formatSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) != 0;
}
int Renderer11::getMajorShaderModel() const
{
switch (mRenderer11DeviceCaps.featureLevel)
......@@ -2996,11 +2980,11 @@ IndexBuffer *Renderer11::createIndexBuffer()
return new IndexBuffer11(this);
}
StreamProducerImpl *Renderer11::createStreamProducerD3DTextureNV12(
StreamProducerImpl *Renderer11::createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs)
{
return new StreamProducerNV12(this);
return new StreamProducerD3DTexture(this);
}
bool Renderer11::supportsFastCopyBufferToTexture(GLenum internalFormat) const
......
......@@ -164,8 +164,6 @@ class Renderer11 : public RendererD3D
bool getShareHandleSupport() const;
bool getNV12TextureSupport() const;
int getMajorShaderModel() const override;
int getMinorShaderModel() const override;
std::string getShaderModelSuffix() const override;
......@@ -299,9 +297,8 @@ class Renderer11 : public RendererD3D
IndexBuffer *createIndexBuffer() override;
// Stream Creation
StreamProducerImpl *createStreamProducerD3DTextureNV12(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
// D3D11-renderer specific methods
ID3D11Device *getDevice() { return mDevice; }
......
......@@ -4,9 +4,9 @@
// found in the LICENSE file.
//
// StreamProducerNV12.cpp: Implements the stream producer for NV12 textures
// StreamProducerD3DTexture.cpp: Implements the stream producer for D3D11 textures
#include "libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h"
#include "libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.h"
#include "common/utilities.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
......@@ -15,17 +15,81 @@
namespace rx
{
StreamProducerNV12::StreamProducerNV12(Renderer11 *renderer)
: mRenderer(renderer), mTexture(nullptr), mArraySlice(0), mTextureWidth(0), mTextureHeight(0)
namespace
{
egl::Error GetGLDescFromTex(ID3D11Texture2D *const tex,
const UINT planeIndex,
egl::Stream::GLTextureDescription *const out)
{
if (!tex)
return egl::EglBadParameter() << "Texture is null";
D3D11_TEXTURE2D_DESC desc;
tex->GetDesc(&desc);
if (desc.Width < 1 || desc.Height < 1)
return egl::EglBadParameter() << "Width or height < 1";
out->width = desc.Width;
out->height = desc.Height;
out->mipLevels = 0;
UINT maxPlaneIndex = 0;
switch (desc.Format)
{
case DXGI_FORMAT_NV12:
// The UV plane of NV12 textures has half the width/height of the Y plane
if ((desc.Width % 2) != 0 || (desc.Height % 2) != 0)
return egl::EglBadParameter() << "NV12 tetxures must have even width and height.";
maxPlaneIndex = 1;
if (planeIndex == 0)
{
out->internalFormat = GL_R8;
}
else
{
out->internalFormat = GL_RG8;
out->width /= 2;
out->height /= 2;
}
break;
case DXGI_FORMAT_R8_UNORM:
out->internalFormat = GL_R8;
break;
case DXGI_FORMAT_R8G8_UNORM:
out->internalFormat = GL_RG8;
break;
case DXGI_FORMAT_R8G8B8A8_UNORM:
out->internalFormat = GL_RGBA8;
break;
default:
return egl::EglBadParameter() << "Unsupported format";
}
if (planeIndex > maxPlaneIndex) // Just kidding, there's no plane out there.
return egl::EglBadParameter() << "Plane out of range";
return egl::NoError();
}
} // namespace
StreamProducerD3DTexture::StreamProducerD3DTexture(Renderer11 *renderer)
: mRenderer(renderer), mTexture(nullptr), mArraySlice(0), mPlaneOffset(0)
{
}
StreamProducerNV12::~StreamProducerNV12()
StreamProducerD3DTexture::~StreamProducerD3DTexture()
{
SafeRelease(mTexture);
}
egl::Error StreamProducerNV12::validateD3DNV12Texture(void *pointer) const
egl::Error StreamProducerD3DTexture::validateD3DTexture(void *pointer,
const egl::AttributeMap &attributes) const
{
ID3D11Texture2D *textureD3D = static_cast<ID3D11Texture2D *>(pointer);
......@@ -37,64 +101,39 @@ egl::Error StreamProducerNV12::validateD3DNV12Texture(void *pointer) const
return egl::EglBadParameter() << "Texture not created on ANGLE D3D device";
}
// Get the description and validate it
D3D11_TEXTURE2D_DESC desc;
textureD3D->GetDesc(&desc);
if (desc.Format != DXGI_FORMAT_NV12)
{
return egl::EglBadParameter() << "Texture format not DXGI_FORMAT_NV12";
}
if (desc.Width < 1 || desc.Height < 1)
{
return egl::EglBadParameter() << "Texture is of size 0";
}
if ((desc.Width % 2) != 0 || (desc.Height % 2) != 0)
{
return egl::EglBadParameter() << "Texture dimensions are not even";
}
return egl::NoError();
const auto planeId = static_cast<UINT>(attributes.get(EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG, 0));
egl::Stream::GLTextureDescription unused;
return GetGLDescFromTex(textureD3D, planeId, &unused);
}
void StreamProducerNV12::postD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes)
void StreamProducerD3DTexture::postD3DTexture(void *pointer, const egl::AttributeMap &attributes)
{
ASSERT(pointer != nullptr);
ID3D11Texture2D *textureD3D = static_cast<ID3D11Texture2D *>(pointer);
// Check that the texture originated from our device
ID3D11Device *device;
textureD3D->GetDevice(&device);
// Get the description
D3D11_TEXTURE2D_DESC desc;
textureD3D->GetDesc(&desc);
// Release the previous texture if there is one
SafeRelease(mTexture);
mTexture = textureD3D;
mTexture->AddRef();
mTextureWidth = desc.Width;
mTextureHeight = desc.Height;
mArraySlice = static_cast<UINT>(attributes.get(EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, 0));
mPlaneOffset = static_cast<UINT>(attributes.get(EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG, 0));
mArraySlice = static_cast<UINT>(attributes.get(EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, 0));
}
egl::Stream::GLTextureDescription StreamProducerNV12::getGLFrameDescription(int planeIndex)
egl::Stream::GLTextureDescription StreamProducerD3DTexture::getGLFrameDescription(int planeIndex)
{
// The UV plane of NV12 textures has half the width/height of the Y plane
egl::Stream::GLTextureDescription desc;
desc.width = (planeIndex == 0) ? mTextureWidth : (mTextureWidth / 2);
desc.height = (planeIndex == 0) ? mTextureHeight : (mTextureHeight / 2);
desc.internalFormat = (planeIndex == 0) ? GL_R8 : GL_RG8;
desc.mipLevels = 0;
return desc;
const auto planeOffsetIndex = static_cast<UINT>(planeIndex + mPlaneOffset);
egl::Stream::GLTextureDescription ret;
ANGLE_SWALLOW_ERR(GetGLDescFromTex(mTexture, planeOffsetIndex, &ret));
return ret;
}
ID3D11Texture2D *StreamProducerNV12::getD3DTexture()
ID3D11Texture2D *StreamProducerD3DTexture::getD3DTexture()
{
return mTexture;
}
UINT StreamProducerNV12::getArraySlice()
UINT StreamProducerD3DTexture::getArraySlice()
{
return mArraySlice;
}
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// StreamProducerNV12.h: Interface for a NV12 texture stream producer
// StreamProducerD3DTexture.h: Interface for a D3D11 texture stream producer
#ifndef LIBANGLE_RENDERER_D3D_D3D11_STREAM11_H_
#define LIBANGLE_RENDERER_D3D_D3D11_STREAM11_H_
......@@ -15,14 +15,15 @@ namespace rx
{
class Renderer11;
class StreamProducerNV12 : public StreamProducerImpl
class StreamProducerD3DTexture : public StreamProducerImpl
{
public:
StreamProducerNV12(Renderer11 *renderer);
~StreamProducerNV12() override;
StreamProducerD3DTexture(Renderer11 *renderer);
~StreamProducerD3DTexture() override;
egl::Error validateD3DNV12Texture(void *pointer) const override;
void postD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) override;
egl::Error validateD3DTexture(void *pointer,
const egl::AttributeMap &attributes) const override;
void postD3DTexture(void *pointer, const egl::AttributeMap &attributes) override;
egl::Stream::GLTextureDescription getGLFrameDescription(int planeIndex) override;
// Gets a pointer to the internal D3D texture
......@@ -36,8 +37,7 @@ class StreamProducerNV12 : public StreamProducerImpl
ID3D11Texture2D *mTexture;
UINT mArraySlice;
UINT mTextureWidth;
UINT mTextureHeight;
UINT mPlaneOffset;
};
} // namespace rx
......
......@@ -14,19 +14,19 @@
#include "common/MemoryBuffer.h"
#include "common/utilities.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/ImageIndex.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/EGLImageD3D.h"
#include "libANGLE/renderer/d3d/TextureD3D.h"
#include "libANGLE/renderer/d3d/d3d11/Blit11.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/Image11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/RenderTarget11.h"
#include "libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.h"
#include "libANGLE/renderer/d3d/d3d11/SwapChain11.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/texture_format_table.h"
#include "libANGLE/renderer/d3d/EGLImageD3D.h"
#include "libANGLE/renderer/d3d/TextureD3D.h"
namespace rx
{
......@@ -1297,8 +1297,8 @@ TextureStorage11_External::TextureStorage11_External(
const egl::Stream::GLTextureDescription &glDesc)
: TextureStorage11(renderer, D3D11_BIND_SHADER_RESOURCE, 0, glDesc.internalFormat)
{
ASSERT(stream->getProducerType() == egl::Stream::ProducerType::D3D11TextureNV12);
StreamProducerNV12 *producer = static_cast<StreamProducerNV12 *>(stream->getImplementation());
ASSERT(stream->getProducerType() == egl::Stream::ProducerType::D3D11Texture);
auto *producer = static_cast<StreamProducerD3DTexture *>(stream->getImplementation());
mTexture.set(producer->getD3DTexture(), mFormatInfo);
mSubresourceIndex = producer->getArraySlice();
mTexture.get()->AddRef();
......
......@@ -906,7 +906,7 @@ IndexBuffer *Renderer9::createIndexBuffer()
return new IndexBuffer9(this);
}
StreamProducerImpl *Renderer9::createStreamProducerD3DTextureNV12(
StreamProducerImpl *Renderer9::createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs)
{
......
......@@ -318,9 +318,8 @@ class Renderer9 : public RendererD3D
IndexBuffer *createIndexBuffer() override;
// Stream Creation
StreamProducerImpl *createStreamProducerD3DTextureNV12(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
// Buffer-to-texture and Texture-to-buffer copies
bool supportsFastCopyBufferToTexture(GLenum internalFormat) const override;
......
......@@ -63,7 +63,7 @@ ContextImpl *DisplayGL::createContext(const gl::ContextState &state)
return new ContextGL(state, mRenderer);
}
StreamProducerImpl *DisplayGL::createStreamProducerD3DTextureNV12(
StreamProducerImpl *DisplayGL::createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs)
{
......
......@@ -37,9 +37,8 @@ class DisplayGL : public DisplayImpl
ContextImpl *createContext(const gl::ContextState &state) override;
StreamProducerImpl *createStreamProducerD3DTextureNV12(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
egl::Error makeCurrent(egl::Surface *drawSurface, egl::Surface *readSurface, gl::Context *context) override;
......
......@@ -174,7 +174,7 @@ ContextImpl *DisplayNULL::createContext(const gl::ContextState &state)
return new ContextNULL(state, mAllocationTracker.get());
}
StreamProducerImpl *DisplayNULL::createStreamProducerD3DTextureNV12(
StreamProducerImpl *DisplayNULL::createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs)
{
......
......@@ -64,9 +64,8 @@ class DisplayNULL : public DisplayImpl
ContextImpl *createContext(const gl::ContextState &state) override;
StreamProducerImpl *createStreamProducerD3DTextureNV12(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
private:
void generateExtensions(egl::DisplayExtensions *outExtensions) const override;
......
......@@ -183,7 +183,7 @@ ContextImpl *DisplayVk::createContext(const gl::ContextState &state)
return new ContextVk(state, mRenderer.get());
}
StreamProducerImpl *DisplayVk::createStreamProducerD3DTextureNV12(
StreamProducerImpl *DisplayVk::createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs)
{
......
......@@ -60,9 +60,8 @@ class DisplayVk : public DisplayImpl
ContextImpl *createContext(const gl::ContextState &state) override;
StreamProducerImpl *createStreamProducerD3DTextureNV12(
egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
gl::Version getMaxSupportedESVersion() const override;
RendererVk *getRenderer() const { return mRenderer.get(); }
......
......@@ -1972,14 +1972,14 @@ Error ValidateStreamConsumerGLTextureExternalAttribsNV(const Display *display,
return NoError();
}
Error ValidateCreateStreamProducerD3DTextureNV12ANGLE(const Display *display,
const Stream *stream,
const AttributeMap &attribs)
Error ValidateCreateStreamProducerD3DTextureANGLE(const Display *display,
const Stream *stream,
const AttributeMap &attribs)
{
ANGLE_TRY(ValidateDisplay(display));
const DisplayExtensions &displayExtensions = display->getExtensions();
if (!displayExtensions.streamProducerD3DTextureNV12)
if (!displayExtensions.streamProducerD3DTexture)
{
return EglBadAccess() << "Stream producer extension not active";
}
......@@ -1996,24 +1996,38 @@ Error ValidateCreateStreamProducerD3DTextureNV12ANGLE(const Display *display,
return EglBadState() << "Stream not in connecting state";
}
if (stream->getConsumerType() != Stream::ConsumerType::GLTextureYUV ||
stream->getPlaneCount() != 2)
switch (stream->getConsumerType())
{
return EglBadMatch() << "Incompatible stream consumer type";
case Stream::ConsumerType::GLTextureYUV:
if (stream->getPlaneCount() != 2)
{
return EglBadMatch() << "Incompatible stream consumer type";
}
break;
case Stream::ConsumerType::GLTextureRGB:
if (stream->getPlaneCount() != 1)
{
return EglBadMatch() << "Incompatible stream consumer type";
}
break;
default:
return EglBadMatch() << "Incompatible stream consumer type";
}
return NoError();
}
Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
const Stream *stream,
void *texture,
const AttributeMap &attribs)
Error ValidateStreamPostD3DTextureANGLE(const Display *display,
const Stream *stream,
void *texture,
const AttributeMap &attribs)
{
ANGLE_TRY(ValidateDisplay(display));
const DisplayExtensions &displayExtensions = display->getExtensions();
if (!displayExtensions.streamProducerD3DTextureNV12)
if (!displayExtensions.streamProducerD3DTexture)
{
return EglBadAccess() << "Stream producer extension not active";
}
......@@ -2033,6 +2047,12 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
return EglBadParameter() << "Invalid subresource index";
}
break;
case EGL_NATIVE_BUFFER_PLANE_OFFSET_IMG:
if (value < 0)
{
return EglBadParameter() << "Invalid plane offset";
}
break;
default:
return EglBadAttribute() << "Invalid attribute";
}
......@@ -2045,7 +2065,7 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
return EglBadState() << "Stream not fully configured";
}
if (stream->getProducerType() != Stream::ProducerType::D3D11TextureNV12)
if (stream->getProducerType() != Stream::ProducerType::D3D11Texture)
{
return EglBadMatch() << "Incompatible stream producer";
}
......@@ -2055,7 +2075,7 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
return EglBadParameter() << "Texture is null";
}
return stream->validateD3D11NV12Texture(texture);
return stream->validateD3D11Texture(texture, attribs);
}
Error ValidateGetSyncValuesCHROMIUM(const Display *display,
......
......@@ -90,13 +90,13 @@ Error ValidateStreamConsumerGLTextureExternalAttribsNV(const Display *display,
gl::Context *context,
const Stream *stream,
const AttributeMap &attribs);
Error ValidateCreateStreamProducerD3DTextureNV12ANGLE(const Display *display,
const Stream *stream,
const AttributeMap &attribs);
Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
const Stream *stream,
void *texture,
const AttributeMap &attribs);
Error ValidateCreateStreamProducerD3DTextureANGLE(const Display *display,
const Stream *stream,
const AttributeMap &attribs);
Error ValidateStreamPostD3DTextureANGLE(const Display *display,
const Stream *stream,
void *texture,
const AttributeMap &attribs);
Error ValidateGetSyncValuesCHROMIUM(const Display *display,
const Surface *surface,
......
......@@ -344,19 +344,19 @@ EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalAttribsNV(EGLDisplay dp
return egl::StreamConsumerGLTextureExternalAttribsNV(dpy, stream, attrib_list);
}
EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
{
return egl::CreateStreamProducerD3DTextureNV12ANGLE(dpy, stream, attrib_list);
return egl::CreateStreamProducerD3DTextureANGLE(dpy, stream, attrib_list);
}
EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
{
return egl::StreamPostD3DTextureNV12ANGLE(dpy, stream, texture, attrib_list);
return egl::StreamPostD3DTextureANGLE(dpy, stream, texture, attrib_list);
}
EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
......
......@@ -55,8 +55,8 @@ EXPORTS
eglStreamConsumerAcquireKHR @61
eglStreamConsumerReleaseKHR @62
eglStreamConsumerGLTextureExternalAttribsNV @63
eglCreateStreamProducerD3DTextureNV12ANGLE @64
eglStreamPostD3DTextureNV12ANGLE @65
eglCreateStreamProducerD3DTextureANGLE @64
eglStreamPostD3DTextureANGLE @65
eglGetSyncValuesCHROMIUM @66
eglSwapBuffersWithDamageEXT @67
eglProgramCacheGetAttribANGLE @68
......
......@@ -525,8 +525,8 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/swizzleui3dps.h',
'libANGLE/renderer/d3d/d3d11/StateManager11.cpp',
'libANGLE/renderer/d3d/d3d11/StateManager11.h',
'libANGLE/renderer/d3d/d3d11/StreamProducerNV12.cpp',
'libANGLE/renderer/d3d/d3d11/StreamProducerNV12.h',
'libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp',
'libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.h',
'libANGLE/renderer/d3d/d3d11/SwapChain11.cpp',
'libANGLE/renderer/d3d/d3d11/SwapChain11.h',
'libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp',
......
......@@ -657,9 +657,9 @@ EGLBoolean EGLAPIENTRY StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
return EGL_TRUE;
}
EGLBoolean EGLAPIENTRY CreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
EGLBoolean EGLAPIENTRY CreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLAttrib attrib_list = 0x%0.8p",
......@@ -670,15 +670,14 @@ EGLBoolean EGLAPIENTRY CreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
Stream *streamObject = static_cast<Stream *>(stream);
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
Error error =
ValidateCreateStreamProducerD3DTextureNV12ANGLE(display, streamObject, attributes);
Error error = ValidateCreateStreamProducerD3DTextureANGLE(display, streamObject, attributes);
if (error.isError())
{
thread->setError(error);
return EGL_FALSE;
}
error = streamObject->createProducerD3D11TextureNV12(attributes);
error = streamObject->createProducerD3D11Texture(attributes);
if (error.isError())
{
thread->setError(error);
......@@ -689,10 +688,10 @@ EGLBoolean EGLAPIENTRY CreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
return EGL_TRUE;
}
EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
EGLBoolean EGLAPIENTRY StreamPostD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, void* texture = 0x%0.8p, "
......@@ -704,14 +703,14 @@ EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
Stream *streamObject = static_cast<Stream *>(stream);
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
Error error = ValidateStreamPostD3DTextureNV12ANGLE(display, streamObject, texture, attributes);
Error error = ValidateStreamPostD3DTextureANGLE(display, streamObject, texture, attributes);
if (error.isError())
{
thread->setError(error);
return EGL_FALSE;
}
error = streamObject->postD3D11NV12Texture(texture, attributes);
error = streamObject->postD3D11Texture(texture, attributes);
if (error.isError())
{
thread->setError(error);
......
......@@ -70,15 +70,15 @@ StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list);
// EGL_ANGLE_stream_producer_d3d_texture_nv12
// EGL_ANGLE_stream_producer_d3d_texture
ANGLE_EXPORT EGLBoolean EGLAPIENTRY
CreateStreamProducerD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list);
ANGLE_EXPORT EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list);
CreateStreamProducerD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list);
ANGLE_EXPORT EGLBoolean EGLAPIENTRY StreamPostD3DTextureANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list);
// EGL_CHROMIUM_get_sync_values
ANGLE_EXPORT EGLBoolean EGLAPIENTRY GetSyncValuesCHROMIUM(EGLDisplay dpy,
......
#!/usr/bin/python
#!python
# Copyright 2017 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.
......@@ -65,7 +65,7 @@ for description, functions in json_data.iteritems():
proc_data = [(' {"%s", P(%s)}' % (func, angle_func)) for func, angle_func in sorted(all_functions.iteritems())]
with open(out_file_name, 'wt') as out_file:
with open(out_file_name, 'wb') as out_file:
output_cpp = template_cpp.format(
script_name = sys.argv[0],
data_source_name = data_source_name,
......
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_proc_table.py using data from proc_table_data.json.
// Generated by ./gen_proc_table.py using data from proc_table_data.json.
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
......@@ -41,7 +41,7 @@ ProcEntry g_procTable[] = {
{"eglCreatePlatformPixmapSurface", P(egl::CreatePlatformPixmapSurface)},
{"eglCreatePlatformWindowSurface", P(egl::CreatePlatformWindowSurface)},
{"eglCreateStreamKHR", P(egl::CreateStreamKHR)},
{"eglCreateStreamProducerD3DTextureNV12ANGLE", P(egl::CreateStreamProducerD3DTextureNV12ANGLE)},
{"eglCreateStreamProducerD3DTextureANGLE", P(egl::CreateStreamProducerD3DTextureANGLE)},
{"eglCreateSync", P(egl::CreateSync)},
{"eglCreateWindowSurface", P(egl::CreateWindowSurface)},
{"eglDestroyContext", P(egl::DestroyContext)},
......@@ -88,7 +88,7 @@ ProcEntry g_procTable[] = {
P(egl::StreamConsumerGLTextureExternalAttribsNV)},
{"eglStreamConsumerGLTextureExternalKHR", P(egl::StreamConsumerGLTextureExternalKHR)},
{"eglStreamConsumerReleaseKHR", P(egl::StreamConsumerReleaseKHR)},
{"eglStreamPostD3DTextureNV12ANGLE", P(egl::StreamPostD3DTextureNV12ANGLE)},
{"eglStreamPostD3DTextureANGLE", P(egl::StreamPostD3DTextureANGLE)},
{"eglSurfaceAttrib", P(egl::SurfaceAttrib)},
{"eglSwapBuffers", P(egl::SwapBuffers)},
{"eglSwapBuffersWithDamageEXT", P(egl::SwapBuffersWithDamageEXT)},
......
......@@ -635,9 +635,9 @@
"eglStreamConsumerGLTextureExternalAttribsNV"
],
"EGL_ANGLE_stream_producer_d3d_texture_nv12": [
"eglCreateStreamProducerD3DTextureNV12ANGLE",
"eglStreamPostD3DTextureNV12ANGLE"
"EGL_ANGLE_stream_producer_d3d_texture": [
"eglCreateStreamProducerD3DTextureANGLE",
"eglStreamPostD3DTextureANGLE"
],
"EGL_CHROMIUM_get_sync_values": [
......
......@@ -119,7 +119,7 @@ class MockEGLFactory : public EGLImplFactory
MOCK_METHOD3(createImage,
ImageImpl *(const egl::ImageState &, EGLenum, const egl::AttributeMap &));
MOCK_METHOD1(createContext, ContextImpl *(const gl::ContextState &));
MOCK_METHOD2(createStreamProducerD3DTextureNV12,
MOCK_METHOD2(createStreamProducerD3DTexture,
StreamProducerImpl *(egl::Stream::ConsumerType, const egl::AttributeMap &));
};
......
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