Commit Graph
192 Commits
Author SHA1 Message Date
Corentin Wallez e5882825af Texture::copyImage: Correctly compare against FBAttachment
There is no functional changes, but avoids an incorrect static_cast of
pointers when looking to skip the clear in a copyImage of an image onto
itself.

Change-Id: I35949005016dab5df01e58d27de53dccf38d50c7
Bug: chromium:1125354
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2395617
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-09-08 15:46:41 +00:00
Alexis Hetu d0d523f4b5 Make copyTexImage2D robust when source area is out of bounds
Whenever the source area of the texture being copied is out of
bounds and robust resource init is enabled, it is necessary to
clear the invalid portion of the source area to 0 in the copy
operation, EXCEPT if the source and the destination are the same,
in which case clearing the destination would also clear the source.

Bug: angleproject:3930
Change-Id: Ie9e0c52fff86b5626c82a511319688392b7b073b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2391281
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Alexis Hétu <[email protected]>
2020-09-02 20:34:00 +00:00
Alexis Hétu e3db3d20d4 Revert "Make copyTexImage2D robust when source area is out of bounds"
This reverts commit e1e6f2940c.

Reason for revert: This fix is incorrect, it ends up being a noop. Reverting this first before landing a different fix.

Original change's description:
> Make copyTexImage2D robust when source area is out of bounds
> 
> Whenever the source area of the texture being copied is out of
> bounds and robust resource init is enabled, it is necessary to
> clear the invalid portion of the source area to 0 in the copy
> operation.
> 
> Bug: angleproject:3930
> Change-Id: If1605b917097006c37e7d59c66babbc32d0ba6d8
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378004
> Reviewed-by: Geoff Lang <[email protected]>
> Reviewed-by: back sept 10 - Jamie Madill <[email protected]>
> Commit-Queue: Alexis Hétu <[email protected]>

[email protected],[email protected],[email protected],[email protected]

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: angleproject:3930
Change-Id: I9e37a3f739eb7ce5d6d6ab5ca59d11ce9aae8483
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2388718
Reviewed-by: Alexis Hétu <[email protected]>
Commit-Queue: Alexis Hétu <[email protected]>
2020-09-02 13:40:02 +00:00
Alexis Hetu e1e6f2940c Make copyTexImage2D robust when source area is out of bounds
Whenever the source area of the texture being copied is out of
bounds and robust resource init is enabled, it is necessary to
clear the invalid portion of the source area to 0 in the copy
operation.

Bug: angleproject:3930
Change-Id: If1605b917097006c37e7d59c66babbc32d0ba6d8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378004
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: back sept 10 - Jamie Madill <[email protected]>
Commit-Queue: Alexis Hétu <[email protected]>
2020-08-31 17:05:29 +00:00
Jamie Madill ea3f501e62 Feedback Loop Redesign 3/3: Remove feedback loop tracking.
We now we detect feedback loops by tracking the Framebuffers that the
Texture is bound to. We still have the old tracking method that counts
sampler and image bindings in the code as well.

This CL removes the old front-end tracking for feedback loops. It's no
longer used by any back-ends. This removal should reduce CPU overhead
around Texture and Program binding changes. Reverts the image binding
tracking to the simpler scheme that tracks if a Texture has ever been
bound as an Image. This should practically have little or no perf
effect and we can reinstate some simpler tracking in the future if
required.

Bug: angleproject:4500
Bug: angleproject:4959
Change-Id: Idc625d6e4c519919f97a4dc72dd9c35d262706fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363210
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-08-21 21:34:02 +00:00
Jamie Madill 185d9d08bc Re-land "Feedback Loop Redesign 2/3: Track bound FBOs in Texture."
Re-land fixes the crash when drawing with no bound Program executable.

Currently we track feedback loops by counting the times a Texture is
bound as a sampler or image in a particular context. This is a bit
tricky because Texture bindings change frequently. Relative to the
number of times we need to check for a feedback loop this causes excess
overhead.

Usually Framebuffers have a low number of Textures bound (in many cases
just 1). And Textures aren't usually bound to many different FBOs. So
instead of counting the number of times a Texture is bound as a sampler
or image we will track the Framebuffers that the Texture is bound to.

This CL adds a small vector class to gl::Texture which tracks all the
Framebufer Serials of its bound Framebuffers. We can use this set to
quickly check if there's any potential feedback loop between the a FBO
and this Texture.

We also update the feedback loop check to use this new method. We will
be able to remove the old counting method when we switch the Vulkan
feedback loop handling to use the new tracking in this CL.

Bug: angleproject:4500
Bug: angleproject:4959
Change-Id: If2bd25b08298a99f5e64b4055137f9154b0f0860
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365595
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-08-20 01:24:10 +00:00
Khushal f6fb6da87d Revert "Feedback Loop Redesign 2/3: Track bound FBOs in Texture."
This reverts commit 699bcde0b7.

Reason for revert: Breaking GLES2WebGLDecoderPassthroughTest.DrawArraysInstancedANGLEEnablement. Here is a sample build : https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20x64%20Release%20%28NVIDIA%29/4240

Original change's description:
> Feedback Loop Redesign 2/3: Track bound FBOs in Texture.
> 
> Currently we track feedback loops by counting the times a Texture is
> bound as a sampler or image in a particular context. This is a bit
> tricky because Texture bindings change frequently. Relative to the
> number of times we need to check for a feedback loop this causes excess
> overhead.
> 
> Usually Framebuffers have a low number of Textures bound (in many cases
> just 1). And Textures aren't usually bound to many different FBOs. So
> instead of counting the number of times a Texture is bound as a sampler
> or image we will track the Framebuffers that the Texture is bound to.
> 
> This CL adds a small vector class to gl::Texture which tracks all the
> Framebufer Serials of its bound Framebuffers. We can use this set to
> quickly check if there's any potential feedback loop between the a FBO
> and this Texture.
> 
> We also update the feedback loop check to use this new method. We will
> be able to remove the old counting method when we switch the Vulkan
> feedback loop handling to use the new tracking in this CL.
> 
> Bug: angleproject:4500
> Bug: angleproject:4959
> Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850
> Reviewed-by: Tobin Ehlis <[email protected]>
> Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
> Reviewed-by: Jonah Ryan-Davis <[email protected]>
> Commit-Queue: Jamie Madill <[email protected]>

[email protected],[email protected],[email protected],[email protected]

Change-Id: Ica795036895652add37ac8ed319031f9d5a321ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:4500
Bug: angleproject:4959
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365077
Reviewed-by: Khushal <[email protected]>
Commit-Queue: Khushal <[email protected]>
2020-08-19 21:04:49 +00:00
Jamie Madill 699bcde0b7 Feedback Loop Redesign 2/3: Track bound FBOs in Texture.
Currently we track feedback loops by counting the times a Texture is
bound as a sampler or image in a particular context. This is a bit
tricky because Texture bindings change frequently. Relative to the
number of times we need to check for a feedback loop this causes excess
overhead.

Usually Framebuffers have a low number of Textures bound (in many cases
just 1). And Textures aren't usually bound to many different FBOs. So
instead of counting the number of times a Texture is bound as a sampler
or image we will track the Framebuffers that the Texture is bound to.

This CL adds a small vector class to gl::Texture which tracks all the
Framebufer Serials of its bound Framebuffers. We can use this set to
quickly check if there's any potential feedback loop between the a FBO
and this Texture.

We also update the feedback loop check to use this new method. We will
be able to remove the old counting method when we switch the Vulkan
feedback loop handling to use the new tracking in this CL.

Bug: angleproject:4500
Bug: angleproject:4959
Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850
Reviewed-by: Tobin Ehlis <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-08-19 01:39:46 +00:00
Tim Van Patten 48ba75ac68 Remove TextureCommand
TextureCommand::GenerateMipmap can be moved into gl::Command allowing us
to remove TextureCommand.

Bug: angleproject:4753
Test: CQ
Change-Id: Idc546df519e199ffd3a8b8e03b9868cd9152e9ef
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2338823
Commit-Queue: Tim Van Patten <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2020-08-08 04:57:08 +00:00
Shahbaz Youssefi fc4bd89811 Vulkan: Support ANGLE_external_objects_flags
With this extension, it is possible to import Vulkan images into ANGLE
(similar to EXT_external_objects) while specifying the Vulkan create and
usage flags used to create that image.  This can be used by the
application to drop usage flags it does not need to improve performance,
or add create flags as it requires.

Bug: angleproject:4912
Bug: fuchsia:52759
Change-Id: Ia568973b19670999dd0e69f6ac5548e8ef0c3eec
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2335020
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Michael Spang <[email protected]>
2020-08-05 20:18:12 +00:00
Geoff Lang ab95a44975 Textures that have bound surfaces are always renderable.
Chrome still tends to use ES2 contexts for most rasterization. This is a
problem when trying to use FP16 IOSurfaces for rendering HDR because
GL_RGBA16F is not renderable in ES2. Since a surface is always
renderable, allow rendering to any textures with a bound surface.

Update the tests to verify that ES3 formats can be used with ES2
contexts.

Add tests for RGBA16F IOSurfaces.

BUG: chromium:1103112
Change-Id: I9e8c082fc97a0e072289b097e71fc944988d4872
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2307454
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-07-22 16:10:45 +00:00
Ian Elliott 0df0b79c6a Vulkan: Optimize changing texture max level
For applications that frequently change the texture max level, to a
value that is a subset of the texture's maximum levels, just recreate
the VkImageView's.

Test: NBA 2K20 game play
Bug: b/160976091
Change-Id: I62a05a90cdb90147056ba8cec960c2114479ec37
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300532
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Ian Elliott <[email protected]>
2020-07-20 20:02:14 +00:00
Shahbaz Youssefi b0245f68f3 Vulkan: Remove superseded updates when flushing to image
Especially with emulated formats and robust resource init, a clear is
staged that's often superseded by a data upload to the same subresource.
This change ensures that superseded updates are dropped to avoid
unnecessary GPU work.

Bug: angleproject:4691
Change-Id: I697ccd438b92fd2fff17a5800550694658c95c54
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2262574
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-06-29 17:45:16 +00:00
Shahbaz Youssefi b772a955e7 Vulkan: Make texture syncState aware of upcoming generateMipmap
By letting TextureVk::syncState know it's being called for
generateMipmap, it can make a better decision to initialize the image:

- Staged updates to mips that are going to be overwritten are dropped
- The image is created with full mipchain to avoid a redefine in the
  following generateMipmap() call.

Bug: angleproject:4551
Change-Id: Ic70ee6c0a0b29c7bd62beaff612b2f2d5276defb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2249340
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-06-20 04:14:48 +00:00
Shahbaz Youssefi e7ae237eb9 Vulkan: ANGLE_copy_texture_3d support
Bug: angleproject:4748
Test: CopyTexImage*Vulkan:Texture3DCopy*Vulkan:Texture2DArrayCopy*Vulkan
Test: dEQP.KHR_GLES3/copy_tex_image_conversions_required_cubemap*cubemap*
Change-Id: Ifdc3d455ca8c9e732d0adf4afa9e2809d780ae18
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2246320
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-06-19 05:30:00 +00:00
Jonah Ryan-Davis 7fde3673a4 GL: Support GL_OES_texture_cube_map_array in frontend/GL backend
GL_OES_texture_cube_map_array is core in 3.2. This CL adds the
necessary validation for the frontend, as well as support for this
extension on the GL backend. The next step is to add the changes
to the translator.

Bug: angleproject:3584
Change-Id: I751a9c9f71a553b05fdf6673250290806d8cfbff
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2215306
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-05-27 17:02:56 +00:00
Brandon Schade 8f6d1af995 Vulkan: Implement EXT_texture_format_sRGB_override
Implemented support for EXT_texture_format_sRGB_override
This is done by creating new imageviews for textures with sRGB
overridden that reinterpret the format to its sRGB counterpart.
As preparation for this, textures that use this feature are
reallocated with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT. This will
have a performance cost for textures that use this feature, but
should have no performance cost for regular textures, since they
will not have this bit set.

Bug: angleproject:4561
Test: angle_end2end_tests --gtest_filter=SRGBTextureTest.*Vulkan*
Change-Id: Iba25f1f2b0a7227959c1cb4ba6e3ca8311c20d06
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2152145
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-05-15 16:32:38 +00:00
Cody Northrop 712fea9a57 Sync state when calling getTexImage
ANGLE's mid-execution capture was failing after changes to
defer clears. There were still textures with pending updates
and dirty bits after SwapBuffers. This caused our calls to
Texture::getTexImage to assert.

This was due to a bug where getTexImage was not syncing state.

This change makes the function non-const so that it can update
state directly.

[email protected],[email protected],[email protected]

Test: Manhattan MEC
Bug: angleproject:4517
Change-Id: I717ad44cfc60ae0d4483721f1c91e47c5dda3939
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186170
Reviewed-by: Cody Northrop <[email protected]>
Commit-Queue: Cody Northrop <[email protected]>
2020-05-06 23:42:24 +00:00
Mohan Maiya daed369cfd EGL: Add support for GL_EXT_EGL_image_array extension
Add support for creating 2D array EGLImages. 2D array
textures are core in GLES3.0. Enable the eglImageArray
bool that controls exposure of the extension for all
contexts >= GLES3.0

Bug: angleproject:4604
Tests: angle_end2end_tests --gtest_filter=ImageTest.*2DArray*
Change-Id: Iebc1ad184fe7209ca89d620290337438ac251c56
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2176109
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-05-06 00:16:16 +00:00
Jamie Madill 2a0c359635 Vulkan: Clean up robust and emulated image clears.
This change consolidates image clears in multiple places into a single
site in ImageHelper initialization. It adds support for appending clear
image commands as well as prepend (the default). We prepend clears
because image initialization happens after data upload.

The Vulkan robust clear path now works like the other back-ends. The
change flushed out a bug where partially uninitialized CopyTexImage was
not correctly initializing a texture before triggering a full resource
clear. Texture::copyImage now uses a workaround where we first init the
image before clearing it. After the init we upload the new data.

We'll use the appending clears path when implementing deferred clears.

Bug: angleproject:4517
Change-Id: If9212f3b8cdd0fc8b7e729d364530801a644e164
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2130627
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-04-07 17:38:55 +00:00
Jamie Madill 78a471ba8b TextureGL: Signal DirtyBitsChanged on dirty bits.
This is a refactoring change only in preparation for a change in the
Vulkan back-end. We'll need to split the handling for Vulkan and GL
into different functions.

Bug: angleproject:4517
Change-Id: I2ddf9c70fe247d1dcb4e0aa9ca929bbbd61bd42b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135893
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-04-07 17:37:06 +00:00
Jamie Madill 1c95795f1f Use ImageIndex in ensureSubImageInitialized.
Passes an already initialized struct so we don't need to separately
pass a level and layer.

Also removes some redundant gl:: prefixes in Texture.cpp and adds a new
helper function doesSubImageNeedInit.

Refactoring change only.

Bug: angleproject:4517
Change-Id: Ib2d8a5c9ceaada03cc8d299adcb5aed53a0cf13c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135928
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-04-03 20:17:26 +00:00
Jamie Madill c9c4e4ed84 Track rendering feedback loops by-context.
This fixes an issue where feedback loops detection would trigger false
positives based on texture use in multiple contexts.

1) there are two contexts, C1 and C2, sharing resources
2) in C1, there is a texture T bound to GL_TEXTURE_2D, and a program in
   use that will sample C1
3) in C2, a framebuffer is created and T is bound to it

This fix indexes each set of active bindings in an object by ContextID.
We can potentially redo this solution in the future if this proves to
have too much tracking overhead.

Includes a test writen by Ken Russell.

Bug: angleproject:4517
Change-Id: I67012e68947c42d863dca193972576c82d5f3712
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134406
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2020-04-03 20:14:05 +00:00
Jamie Madill e4aa679c59 Texture: Pass explicit unpack buffer to setImage.
This will allow us to call setImage internally even if there's an
unpack buffer bound. Useful when implementing robust resource init with
copyTexImage in some edge cases.

Bug: angleproject:4517
Change-Id: I7e8e9536ab9222c620e572f7b6c20b08fa29d646
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133088
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2020-04-03 13:16:24 +00:00
Kenneth Russell e39d055d08 Fix robust resource initialization with clipped CopyTexSubImage2D.
When CopyTexSubImage2D calls were clipped against the bounds of the
read framebuffer by the underlying renderer backends, the robust
resource initialization code assumed that the original destination
area would be overwritten by the renderer, which was not the case.

Add new tests which were previously failing on macOS with the
ES2_OpenGL and ES3_OpenGL backends. The Metal backend is still failing
and a follow-on bug has been filed.

Bug: angleproject:4504
Change-Id: I34821dd90597f31b3cbf0921b94756556e485c91
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2116873
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2020-03-24 21:13:22 +00:00
Mohan Maiya 62b7255252 Add support for EXT_EGL_image_external_wrap_modes
Allows for more wrap modes to TEXTURE_EXTERNAL_OES textures

Test: angle_end2end_tests --gtest_filter=ExternalWrapTest.*
Bug: angleproject:4443
Change-Id: I37bde091b166d7471c13c14fd6b0174136b52ecf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2103433
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-03-20 16:15:04 +00:00
Jamie Madill b1eb44bf8f Track if a Texture is bound as a sampler.
This will more easily allow us to detect rendering feedback loops.
We'll need to support feedback loops to enable Manhattan.

Bug: angleproject:4490
Change-Id: I442deebd89dcf0139411688eaa204c5e5b2c2799
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2109334
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-03-19 19:35:22 +00:00
Jamie Madill e54f7ed7d2 Capture/Replay: Fix compressed texture subImage caching.
The prior code was caching the last subImage data. In fact we should be
caching and updating a pixel rectangle. Multiple subImage calls will
update the same rectangle until the final capture call sets up the
replay with the complete initial data.

This was causing an issue with Manhattan and the initial data for 3D
compressed textures. Manhattan uploads these one layer at a time. So
the prior code was trying to pass a single layer's data to the subImage
call for the entire level.

Bug: angleproject:4488
Change-Id: I76765dcea884f9d8ea07908c44e97578ddb0ff0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2107761
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-03-18 17:18:48 +00:00
Alexis Hetu 94de306d8b Extensions suffixes
Added NV/OES suffixes to relevant Extensions members.

Bug: angleproject:3104
Change-Id: Ia1798157086230bde8d11c6fcb4fe93211e996ab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2013168
Reviewed-by: Alexis Hétu <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-01-22 13:24:28 +00:00
Jamie Madill c431d59626 Add Serial to all GL resources.
The Serial will help track active resources for filtering out
inactive setup calls in capture/replay.

Bug: angleproject:4223
Change-Id: I64ba50f27d656c12d45155dc735e9b6f9c04528f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1969062
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-01-08 23:02:16 +00:00
Ian Elliott 5f857839b9 Improve current multisampled renderbuffer/texture support
This is split off from a change to implement multisampled textures for
the Vulkan back-end, and will come before that change.  The changes
include:

- Make a common utility rx::GetSamplePosition() function.  D3D11 and
  Vulkan use the same standard sample positions/locations for 1, 2, 4,
  8, and 16 samples.  The D3D11 back-end has a utility function for
  this, which is being moved to a common location--for use by both the
  D3D11 and Vulkan back-ends.

- Texture::setStorageMultisample() handles converting the "requested number of
  samples" to the actual number of samples used (e.g. converting 3 to 4),
  supported by the underlying back-end).  The actual number used is stored in
  gl::TextureState::mImageDescs, for use by other GLES commands.

- Change some end2end tests to not make assumptions about the supported number
  of samples, but to properly query what is supported.

Bug: angleproject:3565
Bug: angleproject:4196
Change-Id: I1dc12fedd0f8fb4975f90d87486e443b069b7141
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948535
Commit-Queue: Ian Elliott <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
2019-12-05 01:44:32 +00:00
Sunny Sun df41552841 Vulkan: Enable VK_IMAGE_USAGE_STORAGE_BIT when it is needed
VK_IMAGE_USAGE_STORAGE_BIT is always enabled for vkImage, this
increases memory bandwidth in some platforms.
This CL changes the behavior to enable VK_IMAGE_USAGE_STORAGE_BIT
when necessary.

Bug: angleproject:3904
Test: angle_end2end_tests
Test: angle_deqp_gles2_tests
Change-Id: I8ffd37efa8d99d04328fa6232de0755be3273d9e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1857799
Commit-Queue: Sunny Sun <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-11-05 05:02:48 +00:00
Jamie Madill dfc20daf5a Plumb more logic for ANGLE_get_image.
Also implements and tests validation / negative API.

Bug: angleproject:3944
Change-Id: I3385a4255f4fab6a12eee2abfa5ffcce2107359a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879961
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2019-10-28 20:51:04 +00:00
Xinyi He 052167bc15 Vulkan: Mipmap is unconditionally enabled in ANGLE
ANGLE always enables the Mipmap. The fix does redefining
the image with mipmaps and replace the origin one only
when it is necessary.

Bug: angleproject:3737
Change-Id: Ia33a16fd7feae303fb114988059c4eec58c4232d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750627
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
2019-10-23 20:38:28 +00:00
Mingyu Hu 2d0e5b554d GL_EXT_multisampled_render_to_texture extension. Part 2.
For textures that use this extension, a multisampled texture is
implicitly created for the texture.
Upon write or read, the multisampled texture is either return
to be drawn to or resolved and returned as a single sampled texture.

This is the functionality change with end2end tests.

Bug: angleproject:980428
Change-Id: I5776875a132fed7a3f4f00fb02f9e8e250684630
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1773717
Commit-Queue: Rafael Cintron <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-10-15 01:09:07 +00:00
Cody Northrop 6acfca3ad3 Vulkan: Handle texStorage when base level is set
In this scenario, we allow the texStorage call to fully populate the
image, then let dirty bits change the vkImage to reflect the base level.

Bug: angleproject:3948
Bug: angleproject:3949
Test: dEQP-GLES3.functional.shaders.texture_functions.texturesize.*
Change-Id: I1f453653a23b9d1802a374def40c9372ada8822a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1841275
Commit-Queue: Cody Northrop <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-10-07 16:10:50 +00:00
Jamie Madill f703443b1f Use Resource IDs in RefCountObject.
This lets us use strongly typed IDs pretty much everywhere. Only one or
two additional places still use GLuint IDs. Mostly for external queries
and for Framebuffer Attachments.

With some clever type reflection helpers lets us define a single
template function for handling operator== and != for resource IDs.

Refactor in preparation for more Capture/Replay work.

Bug: angleproject:3611
Change-Id: I1c0c848e89eb8a4b769714d57686f816daf01634
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1815550
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Tobin Ehlis <[email protected]>
2019-09-25 23:39:34 +00:00
Stuart Morgan 9d737966ac Standardize copyright notices to project style
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
  initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
  "The ANGLE Project Authors"

These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.

BUG=angleproject:3811

Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-08-14 23:05:33 +00:00
Jamie Madill 2ab08edc00 Use TextureID in place of GLuint handles.
Bug: angleproject:3611
Change-Id: Ie6156e8732b3ca4dc6c4439c059a5481a4dfd250
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738753
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-08-13 12:50:10 +00:00
Jamie Madill da2b649ce9 Texture: Make ImageIndex store layer counts.
Only for 2D array textures.

Bug: angleproject:3189
Change-Id: I9958ab60ffa464aa63f5cb321cbbe14b378f3647
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709109
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2019-07-22 20:12:25 +00:00
Jamie Madill 4416846819 Vulkan: Sync image in TextureVk::syncState.
We can use the DIRTY_BIT_IMPLEMENTATION internal dirty bit in the
gl::Texture class to force calls to ContextVk::syncState. In syncState
we can ensure we call ensureImageInitialized before we get to the
ContextVk. This in turn means we can remove some of the command graph
breaks from TextureVk.

We need to make sure the dirty bits are propagated to EGL Image
siblings with this method. This fixes a potential implementation issue
with EGL images with the GL back-end.

Also makes a state change test a little better by removing some of the
VAO and program init calls before the draw.

Improves perf on the texture change microbenchmark by 12.5%.

Bug: angleproject:3539
Bug: angleproject:3117
Change-Id: I2b5481690801fa98f859a6c02e3f4b974590cd3d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1663839
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-06-20 15:16:16 +00:00
Geoff Lang 857880e5b8 GL: Add extensions to enable hardware video decode on Android.
The Android SurfaceTexture API has to be initialized with a texture id
which Chrome has to query from an ANGLE external texture. It also
rebinds and sets the texture dimensions on calls to
SurfaceTexture.updateTexImage so ANGLE must be notified about these
changes so that state tracking and validation continue to function.

BUG=967410

Change-Id: I92e9077f75835b088da3a8caffb3ff40e9ad0361
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1630293
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2019-06-18 21:10:07 +00:00
Jamie Madill 124f78c2ff Remove gl::Context parameter from Observer functions.
It was only used in exactly one instance in VertexArray. Instead we can
cache a bool and avoid needing to pass it around.

Will make signaling dirty easier in the Vulkan back-end.

Bug: angleproject:3539
Change-Id: Ia570aec051a24a5280df49edc4345c54022b46ec
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1663838
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2019-06-18 18:06:17 +00:00
Jamie Madill 6722009ef5 Vulkan: Handle dirty RTs with state messages.
Prior to this CL we were handling dirty state change notifications by
flushing the RT Images just prior to use or just after they were
changed. This could lead to a few redundant checks in several places.
It also meant we needed an owner pointer from the RT to the parent
Image. This pointer would be null for Surfaces and Renderbuffers.

This cleans up the image flushing logic to be handled by dirty bit
notifications. When an app updates an attached Texture with TexSubImage
or related calls it will send a notification to the Framebuffer. The
Framebuffer then sets a dirty contents bit that is handled in the
implementation. In Vulkan this means flushing the dirty bits.

Requires adding a flag to the FramebufferImpl class to determine if we
need to syncState before we checkStatus. Adding the option allows us to
only call syncState for the GL back-end. Not calling syncState allows
the robust resource init operation to happen *before* we syncState.
Which in turn allows FramebuffeVk to initialize the VkImages in one go.

Added new regression tests for Texture updates. This might not cover
all cases. I found it was very hard to trigger some of the resource
update staging in TextureVk.

Bug: angleproject:3427
Change-Id: Idfa177436ba7fcb9d398f2b67922e085f778f82a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601552
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2019-05-27 21:33:47 +00:00
Jamie Madill 0a1eeb8064 Call robust resource init before object sync.
This should let the Vulkan back-end only need to sync the Image data
once before we use them.

Bug: angleproject:3427
Change-Id: I8c6e8794e861f855bddbf651997351e8415e3479
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1602912
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-05-13 19:04:27 +00:00
Jamie Madill e4faae213d Rename state change notification messages.
This makes the style use CamelCase instead of ALL_CAPS. It also cleans
up some of the naming. It also changes some uses of the messages in
some of the objects to hopefully be more consistent. See the comments
added to the enum SubjectMessage in Observer.h for more details.

Bug: angleproject:3427
Change-Id: I6dff4f6d335ecf1a27e48df65743b1490bd3025a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1600411
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-05-10 15:08:22 +00:00
Michael Spang f02a767d73 Vulkan: Implement glTexStorageMem2DEXT
This implements support for creating textures that alias vulkan images
allocated inside external memory.

Bug: angleproject:3289

Change-Id: Iad071f353a217793102ae737647c7cd572f7b0ad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552029
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Michael Spang <[email protected]>
2019-04-18 18:47:31 +00:00
Jamie Madill e4458b7bb6 Fix glCopyTexSubImage3D.
Two bugs were present in our implementation. We were using the y offset
for z in ensureSubImageInitialized. And for our D3D back-end we were
potentially reading from the wrong image index.

Bug: chromium:947342
Change-Id: If39671a911e08fcc641b9ba6f5910e3a2c16eb5d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558671
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2019-04-09 20:13:58 +00:00
Geoff Lang 3702d8c9d3 Propogate dirty bit signals from TextureImpl to Texture up to Context.
If TextureImpl sets a local dirty bit and signals gl::Texture of it, the
dirtyness is not propogated to context.  This can result in draw calls
with textures that are not synchronized

BUG=949985

Change-Id: I9baf82c96598265a6a4850f1fd48e213b5e98ab5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1556699
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2019-04-09 16:47:44 +00:00
James Darpinian 5fd08af41f Sampler state overrides texture state if set
The new validation added in http://crbug.com/809237 failed to consider
that sampler object state overrides texture object state if a sampler
object is bound. State caching makes this complicated to fix.

Fixes WebGL conformance test incompatible-texture-type-for-sampler.html
https://github.com/KhronosGroup/WebGL/pull/2823

Bug: 940080, 809237
Change-Id: I26b0fb35c5630c36248edae80f0298a0cb7e14b8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1522364
Commit-Queue: James Darpinian <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2019-03-28 02:33:51 +00:00