Added the EAGL backend authored by Dean Jackson from Apple, and the
refactoring changes needed to support it side-by-side with the macOS
backend. Ran "git cl format" against these diffs.
Defined the EGL_ANGLE_device_eagl extension and allocated an enum out
of ANGLE's reserved range.
The iOS backend is not yet included in any of the GN files.
Bug: angleproject:4263
Change-Id: I631c32930433c03bb16a242955ffedf55174bb29
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987278
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: James Darpinian <jdarpinian@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Dependencies seem to be incorrectly tracked in some Intel OpenGL
drivers (on macOS specifically), causing crashes in glDeleteTextures
if a GL command buffer is being constructed where those textures are
destinations of CopyTexImage2D/CopyTexSubImage2D. Work around this bug
by flushing before texture deletion if CopyTex{Sub}Image have been
called recently. The tracking is only done on a per-context rather
than a per-device basis, but seems sufficient to work around the
problem as identified.
Tested both with new ANGLE test on affected hardware, and in WebKit's
ANGLE backend for WebGL. Works around the crash reported in
https://bugs.webkit.org/show_bug.cgi?id=205707 .
Bug: angleproject:4267
Change-Id: I2266a5590759f6a3f19080def08710ef4b66d463
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987932
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
In https://crrev.com/c/1838418 I added the ability to disable
ARB_texture_rectangle so that we can use it in the WebGL implementation
but disable it when compiling user shaders. Unfortunately disabling
and re-enabling the extension causes the shader translator to be
reinitialized which turns out to be more expensive than the actual
work of shader translation, at least for small shaders. It's slow enough
to cause timeouts in WebKit's WebGL conformance test runs.
This introduces an alternate method of disabling ARB_texture_rectangle
in the translator which is much faster because it avoids reinitializing
the translator.
Bug: angleproject:3956
Change-Id: I5d31b683ff19a59bdfd289cfd3c609f64ef5e25b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1991969
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
All ANGLE volk changes have been upstreamed to volk repo so rolling
volk to sync with latest.
Going forward we can just roll when/if we need newer versions of Vulkan
Header supported by volk.
Bug: angleproject:4225
Change-Id: I6132a94010bbc5f3356ebb0b7e2b2b661ecc68b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1991722
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Tobin Ehlis <tobine@google.com>
In the previous version, the IndexedPointsTestUInt tests named
VertexWithColorUnsignedIntOffset* were redundant with UnsignedIntOffset*.
Bug: angleproject:3923
Change-Id: I6b9b8f2bd78882bcac7c3b89e798291ee94eea70
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1988998
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Roll volk to the latest version which supports Vulkan 1.1.130.
I'm attempting to upstream our customizations to that version so
this roll is in preparation of those changes hopefully landing.
Bug: angleproject:4225
Change-Id: I02f3bd3808f812c0ec8196b6c815a781e7ab5eeb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1989479
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Tobin Ehlis <tobine@google.com>
This fixes a crash (preceeded by Vulkan validation errors) when running
the following test:
--gtest_filter=dEQP.KHR_GLES31/core_texture_storage_multisample_FunctionalTests_blitting_multisampled_depth_attachment* --use-angle=vulkan
The problem is that GraphicsPipelineDesc::updateRasterizationSamples()
is rarely called (e.g. glBindFramebuffer). The above dEQP test changes
between draw attachments that do and don't have multisampling enabled.
The number of samples is set (the first time) to have multisampling
enabled, and never changed, even though other attachments don't have
multisampling.
FramebufferVk::syncState() now calls updateRasterizationSamples(). That
fix uncovered a latent problem: when an application destroys all
framebuffers (including the draw framebuffer), the ContextVk still
points at the old draw framebuffer's FramebufferVk (now freed). This
is fixed with new plubming to clean-up ContextVk::mDrawFramebuffer.
Bug: angleproject:4240
Change-Id: I151ec40ab821efc07c26323c34275c9165ad2ed5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1983393
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
Enable DebugUtils Vulkan extension for Android.
This rolls VK Validation Layer dep forward to include a fix that
allows this extension to work correctly with Android loader.
Here's the Validation layer fix:
https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/1464
Bug: angleproject:3852
Change-Id: I74c55c0a66a7ee4db3b623221c8fb6c4433a39af
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1985175
Commit-Queue: Tobin Ehlis <tobine@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The test fails with the following at a very low flake rate:
../../third_party/angle/src/tests/gl_tests/VertexAttributeTest.cpp:230: Failure
Expected equality of these values:
angle::MakeGLColor(255, 255, 255, 255)
Which is: White
angle::ReadColor((midPixelX + viewportSize[2]) / 2, midPixelY)
Which is: Transparent Black
TBR=jmadill@chromium.org
Bug: angleproject:4269
Change-Id: I82752acfbcb2a067ccb35a7a456def03299c359f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987258
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This change moves driver uniforms to a set with a lower id than the one
that includes (emulation) transform feedback buffers. Imagine the
following:
- Program 1 with xfb: UniformsSet: 1 VS uniforms buffer, 1 FS uniforms
buffer, 1 xfb buffer
- Program 2 without xfb: UniformsSet: 1 VS uniforms bufer, 1 FS uniforms
buffer.
Previously, UniformsSet was index 0, and DriverUniformsSet was index 3.
When switching from Program 1 to Program 2, the layout of UniformsSet
changes, which means every subsequent set needs to be rebound. This is
a Vulkan pipeline layout compatibility rule. This is done with
invalidateCurrentTextures() and invalidateCurrentShaderResources()
already when handling gl::State::DIRTY_BIT_PROGRAM_EXECUTABLE. The bug
is that the driver uniforms are not invalidated.
This is normally not an issue, because usually when switching from
Program 1 to Program 2, transform feedback is paused, and this state
change does invalidate driver uniforms. However, the following scenario
doesn't do this:
- Begin Xfb
- Pause Xfb
- Use Program 1
- Draw
- Use Program 2
- Draw
- End Xfb
There is no driver state change between the two draw calls, which means
the second draw will attempt to draw using the driver uniforms bound for
the first draw call. There is a Vulkan validation error here due to the
above pipeline layout validation rule.
The issue manifests itself only when the second draw call actually uses
driver uniforms, as otherwise that set is inactive and not validated;
i.e. when line raster emulation is used.
In summary, the validation error manifests itself when:
- Transform feedback and line raster both use emulation
- Transform feedback is paused
- A draw with an xfb program is followed by a non-xfb program
- The second draw is a line draw
A test is added for this.
The solution is to reorder the sets so that DriverUniformsSet is placed
before UniformsSet. This way, changes to the layout of UniformsSet
don't invalidate DriverUniformsSet.
In fact, based on the above, any change in the layout of the program
should have required an invalidation of the driver uniforms. This bug
is probably masked by the fact that
ContextVk::handleDirtyDescriptorSetsImpl() always rebinds the graphics
driver every time any descriptor set needs rebinding. That should be
removed in a follow up change.
Bug: angleproject:4261
Change-Id: I21ad4152b454a1fe70554be02e18a9c94fb3e7a8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1986927
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Seeing intermittent failure on this test only on MacOS/NVIDIA/OPENGL.
Suppress for now.
Bug: angleproject:4258
Change-Id: Ibda30954019410e3b6d069986b2cd0ad26533c00
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1984850
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Add attribute to configs.
Add attribute matching logic.
Does not set attribute in Vulkan configs, need solution to
query Android for which formats are valid. anglebug.com/4208
New end2end test.
Bug: angleproject:3961
Test: angle_end2end_tests --gtest_filter=EGLAndroidFramebufferTargetTest*
Change-Id: I7e14c47b39e9539f6181c3c1d75c76fe63ca0f8c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1960508
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Also fix scripts/gen_vk_gl_cts_build.py to always use '/' as file
separator. Otherwise, running the script on Windows uses '\' which
Linux doesn't like.
Test:
angle_deqp_gles31_tests --use-angle=swiftshader --gtest_filter=dEQP.GLES31/functional_debug_negative_coverage_get_error_vertex_array_draw_range_elements
Bug: angleproject:2324
Bug: angleproject:4234
Change-Id: I3b212e0d0ba97996f1d86f7fc81e58c3b03a9cbb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1975020
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
A flag is added to the translator to disable generation of Bresenham
line raster emulation code when the Bresenham line raster Vulkan
extension is present. This is primarily for the sake of conversion of
line raster emulation condition to specialization constant:
- Avoid dead SPIR-V code in every shader
- Avoid ANGLEUniforms being active in every shader stage even if it's
not used anywhere but in line raster emulation.
- Optimize SPIR-V transformations by both having fewer instructions to
iterate through, and to avoid generating line raster patches.
- Reduce the severity of anglebug.com/4251 where the location assignment
of ANGLEPosition can incorrectly overlap a varying array or struct, by
making only platforms without Bresenham extension afflicted by the
bug.
Bug: angleproject:3394
Change-Id: Ic0ae6ce0392b4eae0cc79cb94bbcd0805b276a31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1986379
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
After vertex buffer's attribute is converted and stored in conversion
buffer. Binding the same attribute to another buffer, then binding it
back to previous buffer will result in previous conversion
information lost. The conversion method would skip the conversion due to
buffer's content hadn't been changed, however it didn't reuse the old
conversion result.
This CL also changed the way binding offset is used in Metal backend.
- Previous, the offset would be assigned to the offset field of
MTLVertexAttributeDescriptor, then the buffer would simply be bound to
the command encoder with offset=0
i.e. setVertexBuffer(buffer, index, 0)
- However this approach has several disadvantages. Since Metal doesn't
allow MTLVertexAttributeDescriptor's offset to be larger than the
vertex attribute's stride, the old approach would force the back-end
to convert the attribute and store in conversion buffer.
New approach:
- MTLVertexAttributeDescriptor's offset will be zero. The offset will be
used to bind the buffer itself to the render command encoder.
i.e. setVertexBuffer(buffer, index, offset)
This way the "offset <= stride" restriction no longer exists. The only
restriction is the offset must be multiple of attribute's size.
Added 3 new tests:
- SimpleStateChangeTest.RebindTranslatedAttribute
- VertexAttributeTest.DrawWithLargeBufferOffset
- VertexAttributeTest.DrawWithLargeBufferOffsetAndLessComponents
Bug: angleproject:2634
Change-Id: I6c2fa8091436e4a24405d791f86d17d97df02d64
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940009
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
run_code_generation.py updated comments with 2019 to 2020.
Put all date updates into this one CL.
This also updated hashes.
Bug: angleproject:4262
Change-Id: Ia213dd5e47f155986cbb4161d777724355878af0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1986994
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Use os_log_with_type in ANGLE's logging facility rather than fprintf.
Bug: angleproject:4263
Change-Id: I0c418fc5544001bf4f47ff511d05de2f0ebaa1de
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987145
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: James Darpinian <jdarpinian@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Implement a workaround for widespread bugs calling glReadPixels with
RGBA/UNSIGNED_SHORT against R16/RG16 color attachments. Read back the
data using the GL_IMPLEMENTATION_COLOR_READ_FORMAT, and then rearrange
the read back pixels to fit the RGBA layout.
Also skip RGB16/RGB16_SNORM texture sample test on Nexus 5X/Nexus 6P
due to a another driver bug.
Bug: chromium:1000354, angleproject:4214, angleproject:4215, angleproject:4245
Change-Id: Iedea6f4136878cac5ad0dec3757c77b73502e1cd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1952166
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
The code that patches the line raster emulation directive assumed both
vertex and fragment shaders would be present. This is invalid if only a
vertex shader is present.
This change adds the directive to any stage that's available. This
includes the possibility of a missing vertex shader also, which can be
useful for separable shaders and program pipeline objects.
Bug: angleproject:3394
Change-Id: I84555db81b59c318300003f7108a01f330e4259f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1982782
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Only translate uniform block to StructuredBuffer when system is
Windows 10 and later.
Bug: angleproject:3682
Change-Id: I27e3f4503392791883a44e1d486ffe9512e04bd8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1984863
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
If the Vulkan backend supports VK_EXT_swapchain_colorspace extension,
enable the option for applications to create surfaces with non-linear
formats. Not all formats have non-linear versions and is platform
specific.
Tests: dEQP-EGL.functional.wide_color.*
angle_deqp_egl_tests --use-angle=vulkan --deqp-gl-context-type=egl --deqp-case=dEQP-EGL.functional.wide_color.*
Bug: angleproject:2514
Change-Id: I441ee797cceef92c84473bfa18605c4fd8180de1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1951963
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Some flags were sent as parameters while an Options parameter was added.
This change moves those flags to the GlslangSourceOptions struct.
Bug: angleproject:3394
Change-Id: Iff5c1c83dd564d7bcfcbd84e6df244b7356d669d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1984108
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Also adds a unit test to make sure readIntVector and writeIntVector
match. It was not immediately clear that writing the vector size in
writeIntVector is writing an int instead of a size_t.
Bug: angleproject:3394
Change-Id: I09a003c169dbc47e40c0cd3e4da6f1d7a905c6da
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1983162
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>