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>
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>
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>
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>
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>
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>
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>
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>
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>