Commit Graph
651 Commits
Author SHA1 Message Date
Le Hoang Quyen 8a50b42b01 Metal: Convert index & vertex format on GPU when possible.
- When converting vertex buffer:
  - if there is no render pass active, use compute shader to convert.
  - if there is a render pass active and device supports explicit memory
    barrier then convert the buffer in vertex shader with direct buffer
    write and insert a memory barrier.
  - if there is a render pass active and device doesn't support explicit
    memory barrier then convert the buffer on CPU.

Bug: angleproject:2634
Change-Id: I5346e3a2adb855f40e46a3912d9db404a4482e0f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2434025
Commit-Queue: Le Hoang Quyen <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2020-10-31 22:03:13 +00:00
Geoff Lang 8ace36f8c1 Revert "Add a Vulkan feature to compress float32 vertex formats."
Bug: b/167404532
Bug: b/161716126
Change-Id: I95157a006d5c1fd2d3c0c2c2be37fa0403c07f93
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510011
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-10-30 15:14:37 +00:00
Mohan Maiya e895ced6d4 Vulkan: Add OES_shader_image_atomic support
Add support for shader builtins and enable the extension.

Bug: angleproject:3578
Tests: dEQP-GLES31.functional.*image_atomic*
Change-Id: Idd45b2ee62efe1474c6c5947c77da64ff2221bf6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505540
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-29 20:43:25 +00:00
Geoff Lang 68b95b6330 Revert "ANGLE_platform_angle_device_context_volatile_* extensions"
This reverts commit e70f6aa679.

Reason for revert: dEQP failures:
dEQP.EGL/functional_get_frame_timestamps_rgb565_no_depth_no_stencil
dEQP.EGL/functional_get_frame_timestamps_rgb565_no_depth_stencil
dEQP.EGL/functional_hdr_metadata_cta861_3
dEQP.EGL/functional_hdr_metadata_smpte2086
dEQP.EGL/functional_mutable_render_buffer_basic
dEQP.EGL/functional_swap_buffers_with_damage_resize_after_swap_buffer_age_clear
dEQP.EGL/functional_swap_buffers_with_damage_resize_after_swap_buffer_age_clear_clear
dEQP.EGL/functional_swap_buffers_with_damage_resize_after_swap_buffer_age_render
dEQP.EGL/functional_swap_buffers_with_damage_resize_before_swap_buffer_age_clear
dEQP.EGL/functional_swap_buffers_with_damage_resize_before_swap_buffer_age_clear_clear
dEQP.EGL/functional_swap_buffers_with_damage_resize_before_swap_buffer_age_render

Original change's description:
> ANGLE_platform_angle_device_context_volatile_* extensions
>
> Change from Kimmo Kinnunen downstream:
> https://bugs.webkit.org/show_bug.cgi?id=216106
>
> Add two extensions for EAGL and CGL backends to declare the
> underlying platform context being "volatile". It means that
> the thread-global current context is being modified behind
> ANGLE. If ANGLE context is marked volatile for a particular
> API, it will sync the underlying context for every EGL
> function that needs the context. Most intuitive use is
> for the client to call eglMakeCurrent before calling any
> gl function if the client knowns the platform state might
> be dirty.
>
> Implement eglReleaseThread for EAGL and CGL backends.
> Releasing thread will unset the platform current context.
>
> Fix a bug of omitting EGL_ANGLE_device_eagl from being
> advertised.
>
> Bug: angleproject:5104
> Change-Id: I1ec98ad35bc0caada23556ae8697fdef20f65b1a
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2486548
> Commit-Queue: James Darpinian <[email protected]>
> Reviewed-by: Kenneth Russell <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

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

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

Bug: angleproject:5104
Change-Id: Ib683625a55a582c39e5a4a0466038cfa6e782e6c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2507260
Reviewed-by: Geoff Lang <[email protected]>
2020-10-29 15:44:15 +00:00
Geoff Lang f02a6e0c7f Work around Mac glGenerateMipmap with missing levels bug.
Some Mac GL drivers fail to generate mipmaps if level zero is not set
before the texture is first used, all mipmap data is black.

To work around this, whenever a texture level is allocated, ensure that
level zero is also allocated with at least a 1x1 image.

Bug: angleproject:5223
Change-Id: If1a728e017dec600c77a54f7ae185b719aaaae84
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2497569
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2020-10-28 21:18:54 +00:00
James Darpinian e70f6aa679 ANGLE_platform_angle_device_context_volatile_* extensions
Change from Kimmo Kinnunen downstream:
https://bugs.webkit.org/show_bug.cgi?id=216106

Add two extensions for EAGL and CGL backends to declare the
underlying platform context being "volatile". It means that
the thread-global current context is being modified behind
ANGLE. If ANGLE context is marked volatile for a particular
API, it will sync the underlying context for every EGL
function that needs the context. Most intuitive use is
for the client to call eglMakeCurrent before calling any
gl function if the client knowns the platform state might
be dirty.

Implement eglReleaseThread for EAGL and CGL backends.
Releasing thread will unset the platform current context.

Fix a bug of omitting EGL_ANGLE_device_eagl from being
advertised.

Bug: angleproject:5104
Change-Id: I1ec98ad35bc0caada23556ae8697fdef20f65b1a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2486548
Commit-Queue: James Darpinian <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-10-28 00:05:33 +00:00
Shahbaz Youssefi b0db7cca32 Vulkan: Initial emulated prerotation support
This is currently only supported for end2end tests (those which use
ANGLETestBase, excluding those that use WithNoFixture) and Vulkan.  Use
WithEmulatedPreoration(*_VULKAN(), degree) where degree is either 90,
180 or 270.

With emulated prerotation, the window dimensions are physically swapped
if 90 and 270 degrees, while the width and height is still reported as
requested by the test.  In the Vulkan backend, the width and height are
swapped after getting queried from the surface, and prerotation is
assumed.

Bug: angleproject:4901
Change-Id: I294436be4c7015d2a63463c4d61de7b67f38c95d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2495544
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-27 09:23:14 +00:00
Mohan Maiya 5d0458fa5c Vulkan: Add OES_shader_multisample_interpolation support
Support OES_shader_multisample_interpolation extension if
maxInterpolationOffset >= 0.5

Bug: angleproject:3589
Tests: dEQP-GLES31.functional.shaders.multisample_interpolation.*
       dEQP-GLES31.functional.state_query.multisample_interpolation.*
Change-Id: I42997f10be82e3be8b63c56833cbbf791bf4be9b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477905
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-26 17:54:10 +00:00
Geoff Lang 089ef0fa65 Expose glGetTexLevelParameter{if}v before ES 3.1.
Add a new extension, ANGLE_get_tex_level_parameter which allows
users to query texture size and format information before ES 3.1.
This is very useful for re-using existing textures instead of
re-allocating.

Bug: chromium:1132514
Change-Id: I71f6bad8bdacb91875cc81b4884d4c3099235f3f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2469959
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-21 17:23:46 +00:00
Mohan Maiya 553726a4c5 Vulkan: Add OES_shader_multisample_interpolation extension
Addition of 'sample' qualifier keyword and 'interplateAt*'
fragment shader builtin functions with autogen

Bug: angleproject:3589
Change-Id: If358eb371fbcefffa715c8da4ba5e96eefaf6f52
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2477904
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-21 04:57:21 +00:00
Geoff Lang 32f0dd6aee Add Queries and Setters for resource initialization state.
There are cases where we know that the next draw operation will fully
initialize a texture/renderbuffer and we can save the robust resource
init cost.

Default all resource init state to Initialized, any redefinition will
set it back to MayNeedInit.

After setting an individual texture image to initialized, check if
all images are now initialized and update the TextureState::mInitState
to match. The cost of this check is only performed after initializing
an image and allows future init checks to be faster.

Bug: chromium:1132514
Change-Id: Ia23664ae162559d1614f1eb5643e24a491d87f7f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2475456
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-20 20:11:55 +00:00
Courtney Goeltzenleuchter ed876984a9 Vulkan: functionally complete worker thread
Working on enhancing worker thread to completely own primary command
buffers. This will include not only processing SCBs from main thread
into a primary, but also submitting those command buffers to the queue.

The CommandProcessor is a vk::Context so it can handle errors in the
worker thread. When the main thread submits tasks to the worker
thread it also syncs any outstanding errors from the worker.

Include asynchronousCommandProcessing feature that will control
whether the worker thread task does it's work in parallel or not. If
false, we wait for the thread to complete it's work before letting the
main thread continue.  If true, the thread can execute in parallel with
the main thread.

Bug: b/154030730
Bug: b/161912801
Change-Id: I00f8f013d6cbb2af12a172c4f7927855db2f0ebf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2328992
Commit-Queue: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-20 19:03:15 +00:00
Jamie Madill e5590288b8 Rename "texelFetchInvoked" to "texelFetchStaticUse".
Technically more precise because something could be statically used
and never invoked. Also more consistent with the spec.

Bug: angleproject:5176
Change-Id: I70dd0787d67d9f046b7359abb24107cb430f5cae
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2483465
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Mohan Maiya <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
2020-10-19 18:56:20 +00:00
Geoff Lang 6d3d381e72 GL: Update BufferGL to use ANGLE_GL_TRY.
Refactor the check for keeping shadow data into a feature so it's only
initialized once.

Bug: angleproject:3020
Change-Id: I45575c246afa7cd54e3a07d7a8464f4d4f45b3be
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769064
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-19 16:10:25 +00:00
Mohan Maiya 7bbe497aa8 Vulkan: Implement EXT_texture_sRGB_decode
Implement EXT_texture_sRGB_decode. This builds on the existing
functionality from EXT_texture_sRGB_override, with 2 major edge
cases:
1. sRGB_decode allows the texture state to be overridden by
sampler state, which is implemented by forcing a a texture state
sync during updateActiveTextures if a texture is bound to the same
unit as a sampler with that state
2. texelFetch calls require us to reenable decoding, regardless
of decode state. We add a new compiler pass
(FlagSamplersWithTexelFetch) to mark samplers that are used with
texelFetch in order to support this.
This change also re-enables EXT_texture_sRGB_R8, which was disabled
due to a dEQP bug that this change will bypass.

Bug: angleproject:3609
Bug: angleproject:4503
Test: dEQP.GLES31/functional_srgb_texture_decode_skip_decode_*
Test: GLES31/functional_state_query_texture_*_srgb_decode_*
Test: GLES31/functional_state_query_sampler_*_srgb_decode_*
Test: GLES31/functional_debug_negative_coverage_*_srgb_decode_*
Test: GLES31/functional_android_extension_pack_extensions_ext_texture_srgb_decode
Test: angle_end2end_tests --gtest_filter=SRGBTextureTest.*Vulkan*
Change-Id: I4a67e487dc82e2f57c8c87d4bcd8ef442b6fe220
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2359481
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-10-18 22:29:30 +00:00
Jonah Ryan-Davis 96a49a488a GLX, EGL: Support NV_robustness_video_memory_purge
Chrome is showing rendering issues on Linux/Nvidia after returning from
the lock screen. This could be related to the fact that Nvidia drivers
are not able to guarantee conformance after certain events.
By exposing this extension, we can instruct Chrome to reinitialize
contexts after they are purged by the driver. If this is not explicitly
requested, we can still generate an UnknownContextReset to tell apps
to discard the invalid context anyway.

Bug: chromium:1113040
Change-Id: Ie99b6356cc27fea33643d61b1d74f4f68a271d70
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2453689
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2020-10-15 22:33:07 +00:00
Brandon Schade b22e437aff Add GL_EXT_copy_image extension entry points
Bug: angleproject:3593
Change-Id: I6d3a55a3112f5f9b20ef33c859a60b2952bfbc2f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444209
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-14 21:37:05 +00:00
Hyunchang Kim d9a88d63d5 Vulkan: Support OES_texture_cube_map_array extension
Add support for GL_OES_texture_cube_map_array to the Vulkan backend
if the underlying ICD supports creation of of cube array ImageViews

Bug: angleproject:3584
Test: dEQP-GLES31.functional.fbo.color.texcubearray.*
Change-Id: I636cbf347d718abfc1600119b312578370b8e02e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2437989
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-14 16:20:43 +00:00
Jonah Ryan-Davis 1da7ac0ff4 GLX: Workaround to disable GLX_OML_sync_control support.
Some users on Linux/Wayland are reporting issues rendering Chrome
unusable when ANGLE exposes GLX_OML_sync_control. This CL adds a new
feature to ANGLE to disable this extension, but for now we leave the
feature off by default, so users can test it via command line flags.

Bug: chromium:1137851
Change-Id: I804ea935fe441c4794b93ee62ca335e78b9e453a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2468216
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2020-10-14 15:06:02 +00:00
Charlie Lao df6b7298bb Vulkan: Use StoreOp_None_QCOM for read only depth stencil buffer
For read only depth stencil buffers, there is no need to store depth or
stencil value. But we can not use DontCare for storeOp because vulkan
core spec says DontCare indicates data is undefined after this.
VK_QCOM_render_pass_store_ops extension introduces a new store op that
will leave data defined but skip the store. This CL utilize this if the
extension is available.

Bug: angleproject:5055
Change-Id: I104f3d01eb342a2d0cc900f342430e901bde1bff
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2462604
Commit-Queue: Charlie Lao <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-13 03:25:18 +00:00
Geoff Lang cd8eb56468 GL: Work around Mac glBindBufferRange issue.
Mac GL drivers generat errors when binding transform feedback buffers
with glBindBufferBase/glBindBufferRange when the buffer has not been
bound to any binding point before. Work around this by simply binding
the buffer first.

Bug: angleproject:5140
Change-Id: I1895f8367412135c100a5072117c929be8a8e90b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2461826
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-08 23:48:00 +00:00
Le Hoang Quyen 6dfd855a10 Metal: Implement fence sync
Bug: angleproject:2634
Change-Id: If1f7bb12c0e661c8e4b5677798a92440995819e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2433325
Commit-Queue: Le Hoang Quyen <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-10-08 11:56:49 +00:00
Trevor David Black e815afbf88 First pass at increasing inclusivity
Link to the inclusivity rules
https://source.android.com/setup/contribute/respectful-code

Bug: b/162834212
Bug: chromium:1097198
Change-Id: Ied5a9e3879d72bff3f77ea6fcda9b82f30c32c2f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2396737
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Trevor Black <[email protected]>
2020-10-02 19:49:38 +00:00
Mohan Maiya a2d9abef04 Vulkan: Add OES_sample_shading extension entry points
Addition of just the entry points for OES_sample_shading extension.

Bug: angleproject:3587
Change-Id: I7ef5ceb846d130c2d1e0b4ea7dcbe92452b5d7d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2444212
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-10-02 17:08:28 +00:00
Le Hoang Quyen 6136cbcbd6 Metal: Implement transform feedback
- XFB is currently emulated by writing to storage buffers.

- Metal doesn't allow vertex shader to both write to storage buffers and
  to stage output (i.e clip position). So if GL_RASTERIZER_DISCARD is
  NOT enabled, the draw with XFB enabled will have 2 passes:
  + First pass: vertex shader writes to XFB buffers + not write to stage
    output + disable rasterizer.
  + Second pass: vertex shader writes to stage output (i.e.
    [[position]]) + enable rasterizer. If GL_RASTERIZER_DISCARD is
    enabled, the second pass is omitted.
  + This effectively executes the same vertex shader twice. TODO:
    possible improvement is writing vertex outputs to buffer in first
    pass then re-use that buffer as input for second pass which has a
    passthrough vertex shader.

- If GL_RASTERIZER_DISCARD is enabled, and XFB is enabled:
  + Only first pass above will be executed, and the render pass will use
    an empty 1x1 texture attachment since rasterization is not needed.

- If GL_RASTERIZER_DISCARD is enabled, but XFB is NOT enabled:
  + we still enable Metal rasterizer.
  + but vertex shader must emulate the discard by writing gl_Position =
    (-3, -3, -3, 1). This effectively moves the vertex out of clip
    space's visible area.
  + This is because GLSL still allows vertex shader to write to stage
    output when rasterizer is disabled. However, Metal doesn't allow
    that. In Metal, if rasterizer is disabled, then vertex shader must
    not write to stage output.

- See src/libANGLE/renderer/metal/doc/TransformFeedback.md for more
  details.

Bug: angleproject:2634
Change-Id: I6c700e031052560326b7f660ee7597202d38e6aa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408594
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2020-10-01 18:04:08 +00:00
Shahbaz Youssefi a3b16c6b50 Vulkan: Workaround vkCmdClearAttachment bug on Pixel
Adds a workaround to use draw calls to clear color instead of
vkCmdClearAttachment when the clear happens in the middle of render
pass.  On Pixel phones, vkCmdClearAttachment races with the previous
draw calls in the render pass.

Bug: b/166809097
Change-Id: I8c96b87793da191757635658ad4ee2c3a7875aca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2382416
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-09-25 23:49:02 +00:00
Jamie Madill 7a0faa8292 Revert "Pass #pragma optimize setting down to compilation."
This reverts commit 499173de1c.

Reason for revert: Causes unexpected HLSL compiler errors in some
cases. See bug.

Bug: angleproject:5094

Original change's description:
> Pass #pragma optimize setting down to compilation.
>
> This will allow us to disable optimizations in the back-end. This can
> be useful both for developers and for ANGLE to disable very slow
> shader compilation on D3D11.
>
> Also apply this pragma to VerifyMaxVertexUniformVectorsWithSamplers.
> Reduces compilation time by half in local testing.
>
> Bug: angleproject:5076
> Change-Id: I64ad576e11b9cee5b41f8af0d3621570304d65c2
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2420749
> Commit-Queue: Jamie Madill <[email protected]>
> Reviewed-by: Jonah Ryan-Davis <[email protected]>
> Reviewed-by: Geoff Lang <[email protected]>

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

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

Bug: angleproject:5076
Change-Id: I733e788fe8e9421ae0af662c0eb51af1ed79dde3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2429517
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-09-24 22:14:21 +00:00
Shahbaz Youssefi a76b68362a Vulkan: Support MSRTT depth/stencil resolve
VK_KHR_depth_stencil_resolve is used by this change to resolve
depth/stencil multisampled-render-to-texture renderbuffers.

This extension is not widely supported yet.  If it's not present, the
depth/stencil resolve operation is silently ignored and the renderbuffer
acts as a normal multisampled one.  This is not correct, but our primary
user (Chrome), and most applications don't care for the resolved
depth/stencil data.  In fact, it's recommended for the depth/stencil
attachment to be invalidated after rendering.

Exposing EXT_multisampled_render_to_texture even in the absence of
depth/stencil resolve allows the majority of the applications to still
take advantage of MSRTT color attachments.

Bug: angleproject:4836
Change-Id: I6ba4187344a0c9330d2c77bdc5e2c6fc5483c299
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2417645
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-09-24 15:34:24 +00:00
Geoff Lang f0b020544c Add a Vulkan feature to compress float32 vertex formats.
Use the vertex conversion pipeline in VertexArrayVk to detect
static vertex data and convert float32 vertices to float16. This
feature is useful for determining if an allication is vertex
bandwidth bound and seeing what gains could be had by using smaller
attributes.

This feature could be implemented in ANGLE's frontend but new
infrastructure for converting and storing the converted attributes
would need to be added to gl::VertexArray. Our backends already
have the functionality needed to handle unsupported attribute formats
and this can be repurposed for compressing vertex formats.

Bug: b/167404532
Bug: b/161716126
Change-Id: I9a09656a72e8499faa4124adf876d7261c8341c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2342285
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-09-24 14:55:24 +00:00
Geoff Lang 49f01a53b0 Vulkan: Add features to modify sampling parameters
Add features to optionally increase the LoD offset of all sampling
operations or disable linear filtering. These can be used to compare
performance without recompiling ANGLE.

These features could be potentially implemented in the frontend it is
more difficult because the features are not available at texture
initialization time.

Bug: b/167404532
Change-Id: Ifcf56fbcf130c24c54834737733bbffa5ade3959
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2411475
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-09-22 16:30:45 +00:00
Jamie Madill 499173de1c Pass #pragma optimize setting down to compilation.
This will allow us to disable optimizations in the back-end. This can
be useful both for developers and for ANGLE to disable very slow
shader compilation on D3D11.

Also apply this pragma to VerifyMaxVertexUniformVectorsWithSamplers.
Reduces compilation time by half in local testing.

Bug: angleproject:5076
Change-Id: I64ad576e11b9cee5b41f8af0d3621570304d65c2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2420749
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-09-22 15:31:04 +00:00
Mohan Maiya 48588bd181 Vulkan: Add GL_EXT_buffer_storage extension entry points
Addition of just the entry points for GL_EXT_buffer_storage extension.

Bug: angleproject:5056
Change-Id: I7a3d7c151f004f89fd945d5d06dbe7afcd491578
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2419951
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-09-21 00:03:30 +00:00
Shahbaz Youssefi 68c424fe42 Vulkan: Workaround oldSwapchin bug on Android
When vkCreateSwapchainKHR is called with a valid oldSwapchain, the
Android framework destroys the images in oldSwapchain.  This is not
correct, as it should be deferred to the actual vkDestroySwapchainKHR
call performed later by ANGLE.  This is because rendering to the
oldSwapchain could still be in progress.

While this issue affects all of Android, currently only ARM shows any
symptoms.  A workaround is added for ARM to vkDeviceWaitIdle before
recreating the swapchain if oldSwapchain is valid.

Bug: angleproject:5061
Change-Id: I308e4798c6418d7891d880218b0ebcfd7a795643
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2416238
Reviewed-by: Sunny Sun <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-09-18 04:55:04 +00:00
Jamie Madill 5b0b183063 Add feature for disabling compressed formats.
Can be useful when doing captures to make the replay more portable.

Bug: angleproject:5040
Change-Id: I3a045c636bc2638d601aff2536eed3d0e49c3643
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408714
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2020-09-15 23:41:46 +00:00
Charlie Lao c03c4490a1 Vulkan: Defer glFlush issued in middle of renderpass to endRenderpass
Manhattan is calling glFlush in middle of a renderpass. This CL defers
the flush that issued in the middle of renderpass to the end of
renderpass.

Bug: b/166475273
Change-Id: I6baa3898d5efc456e2205c44e13c64f3d79d1464
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2381942
Commit-Queue: Charlie Lao <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-09-14 23:57:38 +00:00
Jonah Ryan-Davis 1ab73f0f8c Cleanup disable_program_binary workaround
This workaround should also clear the shader binary formats. Also,
we can use this workaround when disabling program binaries for
capture/replay.

Bug: angleproject:5007
Change-Id: I57c78e2cc95e7148cb8a1e7fb9bf3ed958fa69c8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2404383
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-09-10 20:51:01 +00:00
Jonah Ryan-Davis 9a7b0a2dc5 Workaround bogus MscRate reported by some XWayland drivers.
XWayland defaults to a 1hz refresh rate when the surface is not
visible, but this can sometimes cause issues in Chrome. If we see
a bogus rate like that, ANGLE can just report 30hz.

Bug: chromium:1042393
Change-Id: I554b05b4107cea528525ced6e95a5ce529eec3b1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2388700
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2020-09-09 21:04:48 +00:00
Geoff Lang a568b7e38f Add a frontend feature to disable anisotropic filtering.
This allows us to disable support for GL_EXT_texture_filter_anisotropic
at runtime and make performance comparisons.

Bug: b/167404532
Change-Id: Id80458e7f116e195366432fe73e8e776e9a3047b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278024
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2020-09-02 21:09:40 +00:00
Jonah Ryan-Davis 6b2639b023 Workaround to disable OES_get_program_binary
This is a useful workaround for testing/diagnostics.
Disabled by default.

Bug: angleproject:5007
Change-Id: If459f60ae7f8a2cd4ea934fe3e54d890387d57db
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2385933
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
2020-09-02 16:32:15 +00:00
Geoff Lang 7e815c77a4 Implement EXT_shadow_samplers
Bug: angleproject:4863,b/161716126
Change-Id: I6beb45d91f59a851787c9f40b40266fb985198d5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2288330
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: back sept 10 - Jamie Madill <[email protected]>
2020-09-01 19:30:14 +00:00
David Reveman 9a19a996ec Vulkan: Use 4 MB as preferredLargeHeapBlockSize for allocator.
This reduces preferredLargeHeapBlockSize from the default
value of 256 MB to 4 MB, which reduces the initial block
size from 32 MB to 512 KB.

4 MB is the same size as used by Chromium and Skia. It seems
to be a good compromise of not wasting unused allocated space
and not making too many small allocations.

This change is limited to non-Qualcomm GPUs as a number of
tests are failing on Qualcomm after this change and the
initial investigation indicates a potential driver bug. See
http://anglebug.com/4995 for more details.

Bug: chromium:1122718
Bug: fuchsia:58959
Change-Id: Ifdaf863ef38e72098a04ee57dec46ee71cab6ac3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2376891
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: David Reveman <[email protected]>
2020-08-28 16:29:05 +00:00
Le Hoang Quyen a4f706b2ca Metal: Use compute to generate 3D texture's mipmap.
- Metal's built-in blit based mipmap generator doesn't use box
  filtering. Hence manual generation using compute is needed.

- Compute based mipmap gen can generate up to 4 mips per pass if the
  base level is power of 2.

- This approach can be extended to 2D/cube texture's mipmap generation
  in future.

Bug: angleproject:4921
Bug: angleproject:2634
Change-Id: I7f997669fe39afef075b2bca2406e9424cbb3016
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2336120
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Le Hoang Quyen <[email protected]>
2020-08-26 01:58:32 +00:00
Shahbaz Youssefi c76458860d Vulkan: Remove the flipViewportY feature
This was featurized as a workaround for Intel/Windows drivers that did
not render flipped in comparison to GL per Vulkan spec.  This issue has
long since been fixed, and due to missing parentheses the feature was
accidentally unconditionally true for a long time already.

Bug: angleproject:4896
Change-Id: I1db55d298bd47df649ff1f03d287d0cfa7453ea7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2372632
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-08-25 15:08:43 +00:00
Le Hoang Quyen 4f247baf66 Metal: Implement EXT_draw_buffers & ANGLE_framebuffer_blit
Bug: angleproject:2634
Change-Id: I769ca7e113e660870e9b31dafb706c313db8ac24
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2332146
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2020-08-23 19:21:10 +00:00
Jamie Madill 682f9141d1 Remove feedback loop support from back-end.
Front-end detection still in place and will be removed in a follow-up.
Removes the Vulkan feature and the special clear handling.

Bug: angleproject:4959
Change-Id: I5d44c3f7dbdb49d8aa0375f54b7148df09732ba2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363208
Reviewed-by: Tobin Ehlis <[email protected]>
Reviewed-by: Courtney Goeltzenleuchter <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2020-08-21 17:02:47 +00:00
Le Hoang Quyen f37f1dcb16 Metal: Init format table using Metal-Feature-Set-Tables.pdf
- Format table is now initialized using informations from
  https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf.
  Previously, it was setup using gl::GenerateMinimumTextureCaps().

- This CL also adds InitializeTextureDataFunction and LoadFunctionMap to
  mtl::Format. They are needed to properly initialize/convert textures
  with non-normalized formats.

- This CL is prerequisite for integer & floating point format supports.

- New test: DXT1CompressedTextureTest.DXT1Alpha (this test was added
  in the past but was reverted for some reasons).

Bug: angleproject:2634
Change-Id: I5eaad812909a49c4c138d0f65fd21a6a199fcb22
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2332144
Commit-Queue: Le Hoang Quyen <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-08-11 05:55:26 +00:00
Shahbaz Youssefi 1dcb3eb267 Vulkan: Don't expose MSRTT on Mac/SwiftShader
Frequently causes failures as such:

    [...:ERROR:drawing_buffer.cc(854)] Initialization failed to allocate backbuffer.
    [...:INFO:CONSOLE(197)] "Unable to initialize webgl context.", source:  (197)

Bug: chromium:1112986
Bug: angleproject:4937
Change-Id: I5058f78434c0ac49345fe1167043f2dca759b1b9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341350
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-08-07 19:27:56 +00:00
Shahbaz Youssefi e4e2a847da Entry points for ANGLE_external_objects_flags
Bug: angleproject:4912
Bug: fuchsia:52759
Change-Id: If339f096a74cc87d16a6494562711d718a7738ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2335019
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2020-08-05 09:20:36 +00:00
Jonah Ryan-Davis 4f7f438729 Add entry points for OES/EXT_texture_buffer
This extension is core in 3.2

Bug: angleproject:3573
Change-Id: If08736759da2fdc680cfa396d354dbfa97d1a60f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2317040
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2020-08-03 18:08:23 +00:00
Shahbaz Youssefi 41442cce3d Autogenerated changes for GL_EXT_multisampled_render_to_texture2
Bug: angleproject:4836
Change-Id: I86143c6b21ecdbc666ce316b6e4a4b402257f01c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2332957
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
2020-08-01 13:48:53 +00:00