Commit Graph
251 Commits
Author SHA1 Message Date
Shahbaz Youssefi dbc0c646c4 Vulkan: Output the reason for RP closure in command buffer
To make it easier when viewing the command buffer in a graphics
debugger, this change inserts a marker just before closing the render
pass that specifies why the render pass was closed.

Bug: angleproject:2472
Change-Id: I862e500cd58332d6e199c853315c560fe6a73dc2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3265609
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-11-12 15:41:20 +00:00
Tim Van Patten 5d8a89e44f Vulkan: Always override surface format GL_RGB8 to GL_RGBA8
If an app requests to create a surface with GL_RGB8, override it to be
GL_RGBA8 for Android.

This is to workaround an issue with the Android Vulkan loader which
limits which formats can be used with swapchains.

This CL also adds GL_RGB8 back to DisplayVkAndroid::generateConfigs(),
effectively reverting the following CL:
https://chromium-review.googlesource.com/c/angle/angle/+/3235466
This is being done with this CL (rather than reverting) since these
changes are required to handle surfaces created with GL_RGB8.

Bug: angleproject:6277
Bug: angleproject:6651
Change-Id: Iad78ea0d7bdf12e1e309ed6a7181f08fac38b9de
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3258143
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Tim Van Patten <[email protected]>
2021-11-06 02:33:20 +00:00
Lingfeng Yang 2615e6b2cf Remove the syncFramebufferBindingsOnTexImage workaround
It's unused

Bug: angleproject:6503
Change-Id: Ia9039432006ec6988e93db08b9a572c7a7f837ed
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212428
Commit-Queue: Lingfeng Yang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-10-14 20:19:55 +00:00
Shahbaz Youssefi f3d5dac3ba Vulkan: SPIR-V Gen: Drop dependency to glslang
The SPIR-V gen path is now made default.  Compilation through glslang is
still supported for debugging, and is enabled on the GLSL* end2end tests
for smoke testing.  On release builds, glslang is not supported.

To test with glslang, add the following gn arg (only necessary if dcheck
is disabled):

    angle_enable_spirv_gen_through_glslang = true

Then enable the generateSPIRVThroughGlslang feature.  This can be done
by setting an environment variable:

    ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests

Binary size saving:

- 1.3MB on Linux (SPIR-V gen itself: 240KB)
- 730KB on Android (SPIR-V gen itself: 140KB)

Perf tests:

- LinkProgramBenchmark.Run/vulkan_compile_single_thread
  * Through glslang:
      truncated mean: 1287033.36
  * Direct SPIR-V Gen:
      truncated mean: 244495.91  (~80% reduction)

- LinkProgramBenchmark.Run/vulkan_compile_multi_thread
  * Through glslang:
      truncated mean: 4565894.83
  * Direct SPIR-V Gen:
      truncated mean: 1158164.10  (~75% reduction)

Bug: angleproject:4889
Bug: angleproject:6210
Change-Id: I486342702977c8114e90073b97183aba115a8b2d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-10-14 04:43:32 +00:00
Charlie Lao ea5804842b Vulkan: Add feature flag to prefer CPU copy instead of staged update
For ARM GPU, use GPU to do buffer to buffer copy has performance penalty
due to potential bubble in the vertex pipeline. This CL adds a feature
flag preferCPUForBufferDataSubData so that we can enable this behavior
for ARM GPUs.

This CL also tracks if GPU has referenced this BufferVk's storage since
it got new storage. Due to sub-allocation, we may get a new sub-range of
the same BufferHelper object when allocating new storage. But we
currently do not have a way to track GPU progress of the sub-range of a
buffer. So we will end up using BufferHelper's queueSerial to decide if
it is still GPU busy or not. This CL adds mHasBeenReferencedByGPU
boolean variable that will set to false when we got a new allocation and
set to true as soon as buffer is been referenced by any GPU command. We
use this to avoid checking queueSerial if it never been referenced by
GPU. This is a temporary workaround for the bug, the full fix is tracked
by https://issuetracker.google.com/201826021

Bug: b/200067929
Change-Id: I231fb0a678b0165a2ce1775d0aa4dbe7512fb4a8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3183398
Commit-Queue: Charlie Lao <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-10-13 19:43:36 +00:00
Jonah Ryan-Davis 7d1b12eb59 Clean up PlatformMethods enum allocation
EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX was allocated to 0x3482
without reserving an enum in the ANGLE drive. This value was later
used for EGL_POWER_PREFERENCE_ANGLE, causing a collision. This CL
re-allocates the enum.

Bug: angleproject:6105
Change-Id: I0da95dbd307954e2f7f5107d0179d580ec536f2b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3219591
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2021-10-13 18:23:37 +00:00
Jamie Madill 4f0e7e7f23 Vulkan: Remove extraCopyBufferRegion workaround.
Bug: angleproject:2838
Change-Id: I53ba3cf307f930ae9550d1bfee4650df6e826930
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3202475
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2021-10-05 11:27:18 +00:00
Kyle Piddington 54d4bfe5f9 Update ANGLE Metal to Webkit at Sept 29 2021
This commit merges changes from Webkit into ANGLE upstream.
The following commits were used:
Current:
https://git.webkit.org/?p=WebKit.git;a=commit;h=e01d0bda8f4b7dc2fd834b92802d15d8c15735f

Previous:
https://git.webkit.org/?p=WebKit.git;a=commit;h=492f078198748e8ff248eea0bb979cf79e5f5adfj

The following commits were merged in from the Webkit Repository:
(Hashes from git://git.webkit.org/WebKit-https.git)

03ea44c78ce5665d4ec9add271260121cbc7bc6c
     Problems with drawElements in some conditions
     https://bugs.webkit.org/show_bug.cgi?id=230107
c8dc8e0c4d1109d39a62eb197b45e95132380290
     ANGLE Metal: single-component swizzles do not compile
     https://bugs.webkit.org/show_bug.cgi?id=230472
7285dbaaf5af15877d6c332b30ef7a4d67225460
     webgl-compressed-texture-s3tc-srgb.html fails on Intel+AMD Metal
     https://bugs.webkit.org/show_bug.cgi?id=229941
4c72f92967ecd2a095666fef431384c4f5f60fb4
     fragcolor-fragdata-invariant.html fails
     https://bugs.webkit.org/show_bug.cgi?id=223317
cd943145467f54e5928793c0dd3dfa2313c007dd
     ANGLE Metal index buffer restart range cache could be maintained..
     https://bugs.webkit.org/show_bug.cgi?id=227451
f075ff77e592eabd54dd659a8e13617cc5faedc8
     ANGLE Metal infinities and NaNs generated with incorrect syntax
     https://bugs.webkit.org/show_bug.cgi?id=229439
5862073269122f4b2d43d96d3922757557755e86
     [Metal ANGLE] Fix over-autorelease of
     rx::DisplayMtl::getMetalDeviceMatchingAttribute()...
     <https://webkit.org/b/229128>
85f797ad31db048cb82cbafd428ef77f0b839312 ANGLE Cocoa compiles....
     https://bugs.webkit.org/show_bug.cgi?id=228987
a67918ba279ad4842b6ae84a79c3f1c0cdc35ace Avoid infinite recursion...
     https://bugs.webkit.org/show_bug.cgi?id=228978
d341f67de0033adcf1ec6373ace6a54b06c4a031
     Cherry-pick ANGLE: Revise WebGL's shaderSource validation
     https://bugs.webkit.org/show_bug.cgi?id=228951
1e2714d981e97de8234ba055570dfdf56e8b6944
     3.5 MB system-wide footprint impact due to thread-locals...
     https://bugs.webkit.org/show_bug.cgi?id=228240
d32e5cca34081997d32504b0b56c18b9703ff3be
     Build Default Metal library offline
     https://bugs.webkit.org/show_bug.cgi?id=227333
33702279faccfd4c8d1c8a6d549925f9ca9a4e8f
     WebGL2 demo doesn't work due to failing compilation....
     https://bugs.webkit.org/show_bug.cgi?id=226865
0a075885d242db38c4e435a6597173dc3b082173
     rAF driven WebGL submits excessive amount of GPU work...
     https://bugs.webkit.org/show_bug.cgi?id=227059
f38a92b3e7c17efda269caa7066e7ffe2f828e72
     WebGL shader link error in iOS 15 beta: "Internal error..."
     https://bugs.webkit.org/show_bug.cgi?id=227723
98d48f011d561531470d97f26a022767b5452fb7
     REGRESSION (r279466):  [Big Sur] webgl/1.0.3/conformance &...
     https://bugs.webkit.org/show_bug.cgi?id=227596

Bug: angleproject:6471
Change-Id: I07166d0dc4b5c3579d98353485b3245b81c7b882
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3194322
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Kyle Piddington <[email protected]>
2021-10-04 21:47:00 +00:00
Kenneth Russell da3db87ec4 Upstream latest changes to Metal backend from Apple to 7/1/2021
This CL merges in the ANGLE changes between these two WebKit commits:
https://git.webkit.org/?p=WebKit.git;a=commit;h=8648b353ab1d7730438c2e08319e1a4d64982c31
https://git.webkit.org/?p=WebKit.git;a=commit;h=166e4924a52971d6a32ad48247a439b16c00e062

Include provoking vertex buffer out of bounds fix
from https://bugs.webkit.org/show_bug.cgi?id=230107

Fix bad merge of resetting of dirty bits, breaking
DepthStencilFormatsTest.DepthTextureRender test and perhaps others.

Disable GL_APPLE_clip_distance when the direct-to-Metal compiler is
active. It can not yet handle the gl_ClipDistance array.

Disable use of rectangular textures for IOSurfaces. Metal can bind
IOSurfaces to 2D textures, and this was passing all tests in the
SPIR-V Metal backend. Introducing rectangular textures breaks the
SPIR-V Metal backend, and the tests currently fail on the
direct-to-Metal backend.

Fix several bugs with ProvokingVertex, which was causing
both the SpirV and Direct backends to incorrectly draw
indices.
(https://bugs.webkit.org/show_bug.cgi?id=230107)

Skip the following tests on the Metal backend which is still failing
  RobustResourceInitTestES3.BlitDepthStencilAfterClearBuffer
  GLSLTest_ES3.GLVertexIDIntegerTextureDrawArrays/ES3_Metal

With these changes, angle_end2end_tests again runs to completion.

Bug: angleproject:6395
Change-Id: I3cc58f531426a95fc8f177a4ad87f56c1855a546
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3167010
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Kyle Piddington <[email protected]>
2021-10-01 19:25:57 +00:00
Shahbaz Youssefi 458389f249 Vulkan: Support Linux dma-bufs
This change adds support for EGL_EXT_image_dma_buf_import and
EGL_EXT_image_dma_buf_import_modifiers on top of Vulkan's
VK_EXT_external_memory_dma_buf and VK_EXT_image_drm_format_modifier.

Bug: angleproject:6248
Change-Id: I581987f88e9ddcf351dc721f499f63912dca05f9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3145610
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-09-17 20:04:40 +00:00
Shahbaz Youssefi 371542cd16 Vulkan: Use VK_EXT_load_store_op_none
With read-only depth/stencil attachments, ANGLE utilizes storeOp=NONE to
optimize memory bandwidth (by avoiding write back of tile memory at the
end of the render pass). Simultaneoulsy, this avoids a synchronization
hazard with the next write to that depth/stencil image.

If a framebuffer contains a depth/stencil attachment but it's unused,
ANGLE utilizes loadOp=NONE/storeOp=NONE to effectively remove any memory
bandwidth wasted on the attachment.

Bug: angleproject:5371
Change-Id: I76cbadbf1194041532ac4b690ffe087298f2de51
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3114232
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2021-09-14 03:30:27 +00:00
Jamie Madill b6e99bb382 Rename and expand shader variable init feature.
This feature now forces both output and unitialized locals to be
initialized by the shader translator. This feature is needed by the
trace validator to ensure we get deterministic behaviour in traces
that exhibit some undefined results.

Bug: angleproject:5133
Change-Id: Id1242cd077a57e891eed217f7671976ce1631a58
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140216
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2021-09-03 14:47:23 +00:00
Shahbaz Youssefi 58ec0fbfd6 Vulkan: Remove the forceCPUPathForCubeMapCopy workaround
This workaround has been disabled since
https://chromium-review.googlesource.com/c/angle/angle/+/2594707

Bug: angleproject:2822
Bug: angleproject:3055
Change-Id: Ie9cc12c7616cd9e1801dbd92e21822c63f4d0bef
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140214
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-09-02 16:32:11 +00:00
Cody Northrop ef96bde8b0 Vulkan: Fix VVL error regarding geometryStreams
Addresses new validation error:

    [ VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324 ] Validation Error: [ VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324 ] Object 0: handle = 0xb400007e8176af60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xf1034461 | pCreateInfos[0].pRasterizationState pNext chain includes VkPipelineRasterizationStateStreamCreateInfoEXT, but geometryStreams feature is not enabled. The Vulkan spec states: VkPhysicalDeviceTransformFeedbackFeaturesEXT::geometryStreams must be enabled (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324)

The validation was added in this commit:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/bdaec8454a27e65dd81f46bbfad1889b7a3e34f6

Test: World of Kings MEC
Bug: b/198101940
Bug: angleproject:6339
Change-Id: I3cfacc20d231d246500e83451c9ec6b74d9372f2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3127942
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Cody Northrop <[email protected]>
2021-08-30 18:50:39 +00:00
Cody Northrop 5f092f8b51 FrameCapture: Support glProgramBinary
This CL allows applications to use glProgramBinary. Normally this is
a problem because we need program source in order to recreate shaders
in use during mid-execution capture. Use of program binaries
means an app can start and render frames without having submitted
source for that run.

To support this, we will embed program source into ANGLE's binary
format. This will allow us to extract it when the app submits the
binary. We will only embed this when capture is enabled to prevent
increased binary size in the common case. Since this changes ANGLE's
binary format, apps will recreate binaries when capture is enabled.

Additionally, we can't allow captures to have glProgramBinary calls
in the middle of captured frame ranges, so intercept those calls and
replace with a full linking sequence.

Changes include:

- Add new frontend feauture enableProgramBinaryForCapture that allows
  OES_get_program_binary during capture.
- Update ANGLE's binary format to include program source when
  capture is enabled.
- Update maybeOverrideEntryPoint to handle multiple new calls
  instead of a single call.
- Override calls to glProgramBinary that occur mid-capture
  to instead emit a full GenerateLinkedProgram sequence.
- Add checks for created/attached shaders during FrameCapture since
  they won't be available for programs populated by the app using
  glProgramBinary.

Test: Fortnite MEC
Bug: b/180418810
Bug: angleproject:5658
Change-Id: Ib2a0e9e434d3ee0f384d128c48b2a7d4834f5b0f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3105390
Commit-Queue: Cody Northrop <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-08-27 04:15:32 +00:00
Jamie Madill 2f45d93d5b Capture/Replay: Init shader outputs during self-tests.
This forces all uninitialized variables to have default values.
For instance if the application doesn't initialize the output
color, or a varying that's use in the output, this will ensure we
don't use any undefined values in the computation.

Found when working on a re-trace of T-Rex, which doesn't write to
the alpha channel in the final rendering pass. Also fixes undefined
values in GLSLTest.InactiveVaryingInVertexActiveInFragment.

Bug: angleproject:5133
Change-Id: Ia291338e5adf23dab5263cb2ebe737dc05852d3e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3110225
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-08-21 11:25:50 +00:00
Alexey Knyazev eb458fbe59 GL: Add emulateImmutableCompressedTexture3D workaround
The workaround replaces glTexStorage3D with a series
of glCompressedTexImage3D calls.

Bug: chromium:1060012
Change-Id: I08e026e68dd697654cc4ab8feb190a35e56ea133
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3103070
Commit-Queue: Alexey Knyazev <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2021-08-18 21:57:38 +00:00
Kenneth Russell ff64d2c7e5 Choose direct-to-Metal translator through a feature.
Define directMetalGeneration in FeaturesMtl.h. If
ANGLE_ENABLE_METAL_SPIRV is defined to 1 (still the default),
directMetalGeneration defaults to false. It can be overridden via the
standard ANGLE mechanism:
  ANGLE_FEATURE_OVERRIDES_ENABLED=directMetalGeneration

It can also be overridden by instantiating angle_end2end_tests with
the directives:
  WithDirectMetalGeneration(ES2_METAL())
  WithDirectMetalGeneration(ES3_METAL())

These directives aren't working properly yet though. The
direct-to-Metal compiler is instantiated, but the _DirectMetalGen
versions of the tests fail. They pass when switching the Metal
backend's default behavior using the above environment variable. This
will be debugged in follow-on CLs.

Thanks to syoussefi@ for the prototype of this CL:
https://chromium-review.googlesource.com/3076129

Bug: angleproject:5505
Change-Id: I188ab89abc75bf89c5ed2d90102af311feaa1960
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3079083
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
2021-08-11 20:58:45 +00:00
Shahbaz Youssefi 09d5047b41 GL: Remove the rewriteVectorScalarArithmetic workaround
This workaround was implemented for a bug in Nvidia driver 387 which is
end-of-life.  More recent driver branches (390 and 4XX) are fixed, and
so this workaround is no longer required.  The implementation of the
workaround itself could introduce bugs.

Bug: chromium:772651
Bug: chromium:1201084
Change-Id: I3db179eb90d9124235bdad2daacc712302906d8e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3067952
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Yuly Novikov <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2021-08-04 15:47:24 +00:00
Shahbaz Youssefi d0c03ff49e Vulkan: SPIR-V Gen: Fix lvalues passed to in/inout parameters
In GLSL, these values are semantically copied when passed to a function
as an in or inout parameter.  For example in:

    bool f(inout vec4 a, inout vec4 b)
    {
        a = vec4(0);
        return all(equal(a, b));
    }

    var = vec4(1);
    bool result = f(var, var);

result is expected to be false.  In SPIR-V, every parameter is
semantically passed by "reference".

glslang conservatively uses temporaries to pass to functions.  An
optimization in ANGLE didn't create temporaries for unindexed lvalues,
which did not take into account the above fact.  This optimization is
limited to out parameters now.

Bug: angleproject:4889
Change-Id: Ie1b4b1cecba847ba63d5810d01d0856823b89ddc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046103
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-07-24 00:40:43 +00:00
Jeff Vigil d2b659f9a1 EGL: implement EGL_EXT_protected_content Context
Add Validation check to Contexts and Surfaces
Add Vulkan protected memory features and properties
Add protected member to Surfaces and Contexts
Implement hasProtectedContent in Vulkan
Add QueueFamily helper, extent DeviceQueueMap
Protected Swapchains always on for Android
Add EGLProtectedContentTest

Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest

Bug: angleproject:3965
Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413
Commit-Queue: Mohan Maiya <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-07-20 18:11:00 +00:00
Jeff Gilbert 6a86d2079f Add a feature flag allowES3OnFL10_0 to allow ES3 on d3d10.0.
(Originally by Jeff Muizelaar <[email protected]>)
This lets us run WebRender on devices that only support D3D 10.0.

Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1620075

Bug: angleproject:6189
Change-Id: I77c09851c50dee206702b1da25a9ef0c05eeb6c6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3036598
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jeff Gilbert <[email protected]>
2021-07-20 00:33:56 +00:00
Mohan Maiya 31b06f5f79 Vulkan: Account for immutable samplers that need multiple descriptors
It is valid for immutable samplers to need more than 1 descriptor count.
Account for this possiblity while calculating descriptor pool size.

Bug: b/155487768
Bug: angleproject:5033
Bug: angleproject:5773
Bug: angleproject:6141
Change-Id: Ifb0ed3e4b3c01c61d81dd0c628101f31d4c8bd05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3005329
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2021-07-14 17:33:01 +00:00
Kyle Piddington d33a22228e Upstream Apple's direct-to-Metal backend: compile libANGLE.
This change is meant to merge the metal backend changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the metal backend code in a state
that compiles, but not to switch the Metal backend over to using
the direct-to-metal backend yet.

Bug: angleproject:5505
Bug: angleproject:6127
Change-Id: If6783e06e0086b3a1dd25c6f53caca5cfc96cb86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2950067
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Jonah Ryan-Davis <[email protected]>
2021-07-12 14:54:45 +00:00
Shahbaz Youssefi 153240b223 Vulkan: SPIR-V Gen: Support loops
Loops are similar to if-else in that they generate a number of blocks
where the first block specifies divergence (OpLoopMerge) and the merge
block.  Differently from if-else, there is a block where the condition
is evaluated and a block which `continue;` leads to (this last block is
the only one allowed to back-jump to the beginning of the loop).

Bug: angleproject:4889
Change-Id: Ic59f4bf3e05fbf93cb5af85acd3bc4b0da8412af
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2957809
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-06-28 15:02:46 +00:00
Shahbaz Youssefi 5b3142683b Vulkan: Support OVR_multiview and OVR_multiview2
Multiview is supported in Vulkan simply by specifying the number of
views in the render pass, and creating the appropriate image views.  A
number of changes to the way image views and render targets are stored
are made to support those that don't cover the entire range of layers.

One particular detail that is not implemented in this change is the use
of queries in combination with multiview.  Vulkan specifies that N
queries are actually produced (N being the number of views) which must
be summed by the application, but this is not currently done.

Bug: angleproject:6048
Change-Id: I1d4a9894c232d3a93d7a97c9fa0eedc334e57469
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2967625
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2021-06-24 02:29:02 +00:00
Gert Wollny b6009f64aa Capture/Replay: Add feature for robust resource init
Query the feature when creating the display and the context, and
pass the flag to the created context and also to durfaces.

With that we create surfaces that will be marked "MayNeedInit" and
are initialized if the resource is cleared or invalidated.

Bug: angleproject:6041
Change-Id: I292f2e3f931736a18db93695441407e17d2265b6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976656
Commit-Queue: Gert Wollny <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Cody Northrop <[email protected]>
2021-06-23 22:47:37 +00:00
Shahbaz Youssefi b6adeb2f32 Vulkan: Use pipeline statistics query to emulate primitives generated
The VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT query produces
the same result as the GL primitives generated query.  One caveat is
that in combination with rasterizer discard this query may not work.
This is emulated by disabling rasterizer discard when this query is
active and applying an empty scissor instead.

When VK_EXT_primitives_generated_query is released and supported, a
similar issue with rasterizer discard persists so this change will
facilitate using that extension as well.

Bug: angleproject:5430
Change-Id: Id45b6f058c5cb6837e04aa64b1efde28c104e4cf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976181
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
2021-06-23 05:30:06 +00:00
Geoff Lang 8333d06144 GL: Respect TexSubImage upload limits for robust init
The chunked_texture_upload splits texture uploads for glTexSubImage
calls but ANGLE uses glTexSubImage internally for robust resource
initialization. Also chunk those uploads.

Bug: chromium:1181068
Change-Id: Ia6eaac8117173946630f420b396cbc54c163b7ce
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2961230
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-06-15 00:04:03 +00:00
Geoff Lang c12f594a19 GL: Chunk uploads of texture data >120kb on Mac.
Mac drivers are hanging and crashing after large glTexSubImage uploads.
Chunk those uploads to avoid this problematic path in the driver.

Bug: chromium:1181068
Change-Id: I7dca0b8e49420f015ff7830283c14283a0515826
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2928098
Reviewed-by: Kenneth Russell <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-06-01 23:29:47 +00:00
Geoff Lang f410e81a55 GL: Implement multisampled_render_to_texture
Bug: angleproject:2894, angleproject:5988
Change-Id: I17b55f0655d32d9f41cb55a0467b93a00fba751b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2841084
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-05-26 15:00:36 +00:00
Mohan Maiya dd312cc612 Reland "Vulkan: Add support for EXT_texture_border_clamp"
This is a reland of 4b92e089c0
Initializes mPadding to 0 in SamplerDesc::update

Original change's description:
> Vulkan: Add support for EXT_texture_border_clamp
> Add support for GL_EXT_texture_border_clamp. This is implemented by
> using VK_EXT_custom_border_color.
>
> Bug: angleproject:3577
> Test: dEQP-GLES31.functional.texture.border_clamp*
> Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
> Reviewed-by: Jamie Madill <[email protected]>
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Commit-Queue: Mohan Maiya <[email protected]>

Bug: angleproject:3577
Change-Id: I8684242c4bce6e1a006dbe926defaa495fcc2282
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911571
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2021-05-21 18:03:17 +00:00
Yuly Novikov 44fabb7b88 Revert "Vulkan: Add support for EXT_texture_border_clamp"
This reverts commit 4b92e089c0.

Reason for revert: breaks "Linux MSan Tests" bot
https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/28489/overview

Original change's description:
> Vulkan: Add support for EXT_texture_border_clamp
>
> Add support for GL_EXT_texture_border_clamp. This is implemented by
> using VK_EXT_custom_border_color.
>
> Bug: angleproject:3577
> Test: dEQP-GLES31.functional.texture.border_clamp*
> Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
> Reviewed-by: Jamie Madill <[email protected]>
> Reviewed-by: Shahbaz Youssefi <[email protected]>
> Commit-Queue: Mohan Maiya <[email protected]>

Bug: angleproject:3577, angleproject:5996
Change-Id: I6b62f1a4a43fcfe2d0df2c73de24db83606ce430
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911533
Reviewed-by: Yuly Novikov <[email protected]>
Commit-Queue: Yuly Novikov <[email protected]>
2021-05-21 03:36:57 +00:00
Shahbaz Youssefi 9bc837f64b Vulkan: Generate SPIR-V directly from the translator; Part 1
This is the first change in a series to generate SPIR-V directly from
the translator's AST, instead of the generating text GLSL and feeding it
to glslang.

This change implements the majority of the work needed to map AST types
to SPIR-V types, and declare types and interface variables in SPIR-V.
Additionally, it lays the infrastructure to conditionally enabling this
path in end2end tests.

No tests are currently enabled as the change doesn't actually generate
code for function bodies yet.

Bug: angleproject:4889
Change-Id: Iacb28b6907fd48c50e4cc5a0e7ad72f6eed241d4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889603
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
2021-05-19 19:03:10 +00:00
Mohan Maiya 4b92e089c0 Vulkan: Add support for EXT_texture_border_clamp
Add support for GL_EXT_texture_border_clamp. This is implemented by
using VK_EXT_custom_border_color.

Bug: angleproject:3577
Test: dEQP-GLES31.functional.texture.border_clamp*
Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Mohan Maiya <[email protected]>
2021-05-18 18:14:58 +00:00
Geoff Lang 5a0925def4 GL: Recreate textures on eglReleaseTexImage.
Texture data should be reset on eglReleaseTexImage but ANGLE sometimes
skipped this because it generated GL errors on Mac. Instead, delete
and recreate the native texture to make sure ANGLE doesn't hold any
references.

Bug: chromium:1181068
Change-Id: I1252b0900361852f66f73b8c9d20a29c53897ee4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897544
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
2021-05-14 22:52:52 +00:00
Charlie Lao 09dad082c3 Vulkan: Add feature flag to flush at framebuffer boundary
Testing shows most app traces seeing performance improved on ARM GPU
when we flush at FBO boundary instead of one submit per frame. This
likely due to more frequent submission means less chance of GPU
starvation. This also helps ANGLE to detect GPU finish at finer grain
since the queue serial is per submission. Finer grain detection of
object completion means memory gets recycled quicker and mapBufferRange
able to hit fast code path more often. With this CL, manhattan 3.1
offscreen score also score improves 7%. This may also helps onscreen
performance if frame time is on the edge of 16ms by submit FBO rendering
earlier instead of been blocked by vkAcquireNextImage.

Bug: b/187993625
Bug: angleproject:5295
Change-Id: I2946a7159231d36019ace89805a69ac8e906ce94
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2888709
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Ian Elliott <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2021-05-14 18:50:56 +00:00
Geoff Lang ce89d99fde GL: Flush after framebuffer change on Mac 9th gen Intel GPUs
Speculative fix for crashes during flush on Mac. Mirrors the
flush_on_framebuffer_change workaround in Chrome from
http://crbug.com/783979

Bug: chromium:1181068
Change-Id: Ic84b1bfc44babf27016b306393da308d504d7fd9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2859984
Reviewed-by: Peng Huang <[email protected]>
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-04-29 18:01:07 +00:00
Geoff Lang ccd984ff39 Reland "Add a Vulkan feature to compress float32 vertex formats."
This reverts commit 8ace36f8c1.

Original change's description:
> 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]>

Bug: b/167404532
Bug: b/161716126
Change-Id: Ic6811fe3a7124e6eb1efe7c72a1a03a120217753
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815260
Commit-Queue: Geoff Lang <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
2021-04-22 15:16:56 +00:00
Peng Huang be2f7b1cd2 Unbind fbo before context switching for PowerVR GPUs
Imagination GL drivers are buggy with context switching.
We need to ubind fbo to workaround a crash in the driver.

Bug: chromium:1187513
Change-Id: Ie5142b5f43a3f23a9743ba7af0d90567fedd00d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2841083
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Peng Huang <[email protected]>
2021-04-21 01:03:24 +00:00
Amy Liu 9593517622 Handle the compression of big pipeline cache.
Big pipeline cache will cost much time to compress. Regarding the
perfomance, handle the compression of big pipeline cache in this way:
1)Return when the pipeline cache data is larger than 10M.
2)Use worker thread to complete compression.

Bug: angleproject:4722
Change-Id: I62eb69d8c46729261f0502af01450ec301c258f3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2788169
Commit-Queue: Jamie Madill <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-04-20 15:32:08 +00:00
Jonah Ryan-Davis 2d873e0c40 GL: Workaround to sanitize amdgpu renderer strings.
On Linux with the amdgpu driver, the GL_RENDERER string contains
precise kernel and DRM version info. We should sanitize this info
before using these strings for user privacy.

Bug: chromium:1181193
Change-Id: I047d1abf5b51412b4258a021761cc450385ef0fe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2727658
Commit-Queue: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-04-13 22:05:34 +00:00
Geoff Lang 18c6d628c1 GL: Support VAOs without native VAOs.
Share the default VAO state between all frontend VAO when
there is no native VAO support. Forcefully sync state every
time a new frontend VAO is bound.

Bug: angleproject:5577, chromium:1167179
Change-Id: Ieaedb5108ad28fc78e7e58b74495639c5246bb05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665266
Reviewed-by: Jonah Ryan-Davis <[email protected]>
Reviewed-by: Peng Huang <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-04-13 15:55:39 +00:00
Geoff Lang 065c232918 Reland "Vulkan: Add features to modify sampling parameters"
This reverts commit a51b57fa2d.

Original change's description:
> Revert "Vulkan: Add features to modify sampling parameters"
>
> Bug: b/167404532
> Change-Id: Iae19dfe165074e8c01216312bddd744c4fb504a4
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510012
> Commit-Queue: Geoff Lang <[email protected]>
> Reviewed-by: Tim Van Patten <[email protected]>
> Reviewed-by: Jamie Madill <[email protected]>

Bug: b/167404532
Change-Id: I2c756b8eb0f61701ef6e33275e557bc199a4d3b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815259
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Charlie Lao <[email protected]>
Commit-Queue: Geoff Lang <[email protected]>
2021-04-13 15:36:39 +00:00
Nicolas Capens 15f4925ac3 Restore EGL_EXT_buffer_age for SwiftShader Vulkan
EGL_EXT_buffer_age was previously disabled for SwiftShader Vulkan
because of an Android test timing out on Cuttlefish when the buffer
age is queried. aosp/1672445 addresses the root cause of the timeout,
so EGL_EXT_buffer_age can be supported again.

Bug: b/182521420
Bug: angleproject:3529
Change-Id: I5949f721316855d9138eb9f657a6df4e7b49ed71
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2821750
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Nicolas Capens <[email protected]>
2021-04-13 03:05:35 +00:00
Ian Elliott b17a93175d Vulkan: damage rectangles must never be pre-rotated
Remove the SurfaceVk::present() code that rotated damage rectangles
and the feature flag that controlled that rotation.

The Vulkan specification was changed so that the rectangles provided
to the VK_KHR_incremental_present extension must never be pre-rotated.
The spec change requires the same behavior on all platforms (just in
case), even though Android is the only platform known to support
rotation.

FYI: the Vulkan spec change was merge request 4442.

Bug: b/182930524
Change-Id: I5128fd76e718f3d964c9091830bcc5886d265543
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818826
Commit-Queue: Shahbaz Youssefi <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
2021-04-10 02:08:58 +00:00
Charlie Lao e249239c54 Vulkan: Add featue flag to force highp to mediump in fragment shader.
Adding feature flag that forces highp in fragment shader to mediump. It
is disabled by default. You can enable it for experiment.

Bug: b/184850002
Change-Id: I73980be4ad160eb1b17a3a3ecfc09f2e4aeb468c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815240
Reviewed-by: Tim Van Patten <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
2021-04-09 20:26:21 +00:00
Jamie Madill 9a025fd448 Capture/Replay: add frontend feature to force capture limits
Some of the limits set when FrameCapture is enabled are reflected in
the serialized context. In order for capture/replay tests to pass
these limits may also be needed to be enforced when replaying. Add a
fronten feature enable_capture_limits for this and use it in the
capture replay test script.

Patch authored by [email protected].

Bug: angleproject:5750
Change-Id: I3d333d22fe65c12dd5aa5f263d19a2c1568541c2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2790301
Reviewed-by: Jamie Madill <[email protected]>
Commit-Queue: Jamie Madill <[email protected]>
2021-03-28 19:26:30 +00:00
Shahbaz Youssefi d146222879 Vulkan: Use VK_EXT_multisampled_render_to_single_sampled
Additionally, makes the emulation path not require
independentResolveNone.  This was only used to select the NONE resolve
mode when the attachment format doesn't have either of depth or stencil
aspects, but it's ok to specify the same resolve mode for both aspects
even if one aspect is missing.

Bug: chromium:1088005
Change-Id: Ifc37cbf5331145179c5927853b996a0d62b871ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743666
Reviewed-by: David Reveman <[email protected]>
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Tim Van Patten <[email protected]>
Commit-Queue: Shahbaz Youssefi <[email protected]>
2021-03-23 20:44:21 +00:00
Nicolas Capens 135385a1ae Disable EGL_EXT_buffer_age for SwiftShader Vulkan
Cuttlefish with SwANGLE failed to pass the android.graphics.cts.
BitmapTest#testDrawingHardwareBitmapNotLeaking test, due to a timeout in
dequeueBuffer (error = -110) during an EGL_BUFFER_AGE_EXT surface query.

This change conservatively works around the issue by leaving
EGL_EXT_buffer_age support disabled for SwiftShader.

Further investigation is required to check whether this timeout can also
occur with other Vulkan drivers, and if it can be addressed robustly.

Bug: b/182521420
Bug: angleproject:3529
Change-Id: I54e3767e74bf922f273d8860f9f4cfc8b6589536
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2774030
Reviewed-by: Jamie Madill <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Nicolas Capens <[email protected]>
2021-03-20 04:44:57 +00:00