Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Sunny Sachanandani 46555145d8 d3d11: Allow binding R/RG texture to EGLImage
Also allows GL_RED/RG/R16/RG16_EXT as well as GL_RGB10_A2_EXT which was
left out previously by accidently to match Chromium behavior.  Adapts
the existing ClearTextureImage test to parameterize over a number of
texture formats.

Bug: angleproject:6369
Change-Id: I91110a06b08379a3067a2161e345258415cd5e16
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140744
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
2021-09-08 18:55:19 +00:00
Sunny Sachanandani 923f6a6f30 Ignore internal format attribute for YUV D3D11 EGLImages
Internal format doesn't play any role in this case, and causes confusion
due to mixing sized and unsized formats resulting in more complicated
code in Chromium.

Bug: angleproject:5538, chromium:1116101
Change-Id: Ie200026f014850053108aa0416e1da15bcda7b84
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2808855
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-04-12 22:05:04 +00:00
Sunny Sachanandani 137271ffc5 Support specifying array slice for D3D11 texture EGLImage
Client can specify array slice for creating the SRV/RTV with
EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE.

Test: D3DTextureTest.TextureArrayImage*
Bug: angleproject:5538, chromium:1116101
Change-Id: I81cb2823df2145f1d05ad1526b0e36d6a0724d5e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628609
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
2021-01-21 00:10:29 +00:00
Sunny Sachanandani 198dc34538 Support importing NV12/P010/P016 D3D textures as EGLImage
Allow importing individual planes of NV12/P010/P016 D3D textures with
supported SRV/RTV formats.  Restrict these to GL_TEXTURE_EXTERNAL_OES to
limit to using as shader inputs or render targets and prevent
unsupported operations like ReadPixels.

Test: D3DTextureYUVTest*
Bug: angleproject:5538, chromium:1116101
Change-Id: If5bf54f4f75bb2c703890ce3f5fbd67e4461c98f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2338827
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2021-01-13 23:41:01 +00:00
Sunny Sachanandani 3d5f0c8261 Use surface texture offset for clears and blits
https://chromium-review.googlesource.com/c/angle/angle/+/2186176 added
surface texture offset attributes for D3D11 pbuffer surfaces, but the
implementation didn't apply the offset to blits or clears. This CL fixes
that and includes a unit test for blit, clear, and draw.

Also renames textureOffset to surfaceTextureOffset throughout since it's
clearer, and fixes the dcomp surface test to specify the update offset
returned by dcomp BeginDraw().

Bug: angleproject:2997
Change-Id: I9298ccf55cbb2d04c3b8f78e12f9d07dc8fa54b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2210967
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2020-05-26 23:18:47 +00:00
Sunny Sachanandani 4b225c70c1 Add texture offset attributess for D3D texture pbuffer surfaces
Add EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE attributes
to EGL_ANGLE_d3d_texture_client_buffer which are used to specify offsets
used for rendering into the pbuffer surface backed by a D3D11 texture.
Rendering with the correct offset is needed when Chrome gets a texture
and offset from an external source e.g. when calling BeginDraw() on
IDCompositionSurface.

Bug: angleproject:2997
Change-Id: I363f739f3f05c38720f385e34c91e98fc6a622a0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186176
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
2020-05-14 19:24:55 +00:00
Sunny Sachanandani c1af9abfce Add support for overriding internal format for D3D11 texture EGLImages
Add an optional EGL_D3D11_TEXTURE_FORMAT_ANGLE attribute that is the
GL internal format to use for EGLImage being created.  This will be used
for RGB emulation of swap chain texture backed WebGL contexts in Chrome
when they have alpha:false set.  Without RGB emulation it is possible to
observe side-effects of the underlying swap chain being RGBA such as
reading/writing the alpha channel, BlitFramebuffer working/not working
when expected, etc.

Also document creating EGLImages from D3D11 textures in the existing
EGL_ANGLE_d3d_texture_client_buffer extension along with RGB emulation.

Bug: chromium:699566, chromium:939657
Change-Id: I4931cb7bdc46e9bc6debd56b79ecc10ea27bd78b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1777099
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
2019-09-09 21:32:50 +00:00
Sunny Sachanandani b8a8ffd3fc Add support for RGB10A2 in eglCreatePbufferFromClientBuffer
Bug: chromium:937108

Change-Id: I689562ebff9f9f85ecb8af918bbb788b16b0f91b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565420
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2019-04-16 21:04:02 +00:00
Olli Etuaho d66e193930 Allow creating EGL pbuffers from typeless D3D textures
A new extension EGL_ANGLE_d3d_typeless_texture_client_buffer is added
that allows creating EGL pbuffers from typeless D3D textures.

The extension increases the flexibility of the API compared to plain
EGL_ANGLE_D3D_texture_client_buffer. The colorspace for the created
EGL pbuffer can be set by using the EGL_GL_COLORSPACE attribute.
Internally this sets the ANGLE format of the buffer. There are new
ANGLE formats that are used specifically for typeless textures,
separate ones for SRGB and linear views into the D3D textures.

The extension is only supported on the D3D11 backend of ANGLE.

BUG=angleproject:2300
TEST=angle_white_box_tests

Change-Id: I6a6cb873d2cc0dca0b7f18a0f2cd35e7bafcb7d8
Reviewed-on: https://chromium-review.googlesource.com/873917
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2018-01-23 16:15:50 +00:00
Olli Etuaho ceffd20ce2 Set colorspace of D3D pbuffers according to DXGI format
When a EGL pbuffer is created based on a D3D SRGB texture using
EGL_ANGLE_d3d_texture_client_buffer, SRGB conversions are performed as
if it was an SRGB surface. The value of EGL_GL_COLORSPACE now
reflects that correctly. If the pbuffer is bound to a texture and used
as a framebuffer attachment, querying GL_FRAMEBUFFER_COLOR_ATTACHMENT
also reflects that correctly.

The behavior is the same on both the D3D backend, where there is no
native interop involved, and on the GL backend using
WGL_NV_DX_interop(2).

There are a few limitations on the GL backend that relies on native
interop:

1. SRGB conversion for textures created this way can't be disabled
using the GL_FRAMEBUFFER_SRGB_EXT toggle that's exposed in ANGLE
through EXT_sRGB_write_control. This is now documented in the
EGL_ANGLE_d3d_texture_client_buffer spec. On the D3D backend this is
not a problem since EXT_sRGB_write_control is not supported either
way.

2. Creating a pbuffer out of a D3D11 texture with the format
DXGI_FORMAT_B8G8R8A8_UNORM_SRGB does not work, even though it was
listed as one of the supported formats in the
EGL_ANGLE_d3d_texture_client_buffer spec. It's now mentioned that
support for this format is optional.

BUG=angleproject:2300
TEST=angle_white_box_tests

Change-Id: I70ee0646680805e4469291a5b2ce59e92fda009e
Reviewed-on: https://chromium-review.googlesource.com/866743
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
2018-01-16 15:21:51 +00:00
Corentin Wallez 43fd0d44d2 Add the EGL_ANGLE_iosurface_client_buffer extension text
BUG=angleproject:1649

Change-Id: Ie613ae835ea3e7c590f74429bdd36f7a42045131
Reviewed-on: https://chromium-review.googlesource.com/811905
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2017-12-06 21:51:12 +00:00
Bryan Bernhart (Intel Americas Inc) 151d5de65f Enable MSAA for texture client buffers
Enhancement to the EGL_ANGLE_d3d_texture_client_buffer extension to
allow use of a shared D3D texture that can be multi-sampled.

BUG=angleproject:1917

Change-Id: Iaf59bbd575a5dfb29345f55b549bc4017bf2d7d0
Reviewed-on: https://chromium-review.googlesource.com/446907
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
2017-04-24 16:18:33 +00:00
Geoff Lang 2018c0bac4 Add a EGL_ANGLE_d3d_texture_client_buffer extension.
Allows creation of pbuffers from D3D texture objects.

BUG=540829
BUG=angleproject:1144

Change-Id: If8ea717ef011608cd01357c217837133d726d3ea
Reviewed-on: https://chromium-review.googlesource.com/316804
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
2016-10-27 16:45:18 +00:00