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 <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
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 <jdarpinian@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
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 <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
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 <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
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 <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
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 <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <geofflang@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
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 <cclao@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
- 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 <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
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 <syoussefi@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
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 <jmadill@chromium.org>
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=geofflang@chromium.org,jonahr@google.com,jmadill@chromium.org
# 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 <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
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 <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 <geofflang@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
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 <sunny.sun@arm.com>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
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 <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
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 <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 <geofflang@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
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 <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
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 <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: David Reveman <reveman@chromium.org>
- 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 <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Le Hoang Quyen <le.hoang.q@gmail.com>
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 <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 <tobine@google.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
- 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 <le.hoang.q@gmail.com>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Pre-rotation code were added to transform gl_Position, gl_FragCoords,
gl_PointCoords, dFdX, dFdY in shader. However, it is only useful for
android's surface pre-rotation and completely un-needed in Metal
back-end.
This CL disables these pre-rotation code if the platform is not
android.
Bug: angleproject:4678
Change-Id: I89c42fcf24b49896f4ed9c2f9465da521beaf25f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2295000
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Since these are per context, we can increase it (and subject to the
driver maxUniformBufferRange limit) to reduce the amount of descriptor
set allocated.
Bug: b/161391337
Change-Id: I89e5cf16ee377735c412e9a9a22c651e1c677ded
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2310910
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
An initial implementation based on AMD's FFX SPD (Single Pass
Downsampler).
Apart from requiring STORAGE_IMAGE support for the image format, the
following limitations are in place due to FFX SPD:
- Image must be 2D or 2D array (including cube maps)
- Image must be single-sampled
The following _can_ be supported, but not yet implemented:
- sRGB formats
- Integer formats
- depth/stencil formats
Bug: angleproject:4551
Change-Id: Ibc4d5cea701cca31e55e3d651540872bbd3b473f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278713
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Emulate GL_PACK_SKIP_PIXELS and GL_PACK_SKIP_ROWS on macOS, where it
appears the OpenGL driver ignores these parameters.
Add WebGL 2.0-specific validation constraints for pixel pack and
unpack parameters.
Bug: angleproject:4849
Change-Id: Iab566299223e05484a009817acb1ed2816023823
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2303905
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This adds ability for applications to import Android Hardware Buffers
(AHBs) as OpenGL images which in turn can be sampled from and/or
written.
This was specifically tested with the common use case of importing a
buffer created by an media decoder and using that as a texture source to
include that video content on the screen. Tested with:
- Angry Birds 2 video player (for ads) requires YUV conversion.
- Basic Media Decoder example:
https://github.com/android/media-samples/tree/master/BasicMediaDecoder
Bug: b/155487768
Change-Id: I9255450f81aa4daa2aace7205d4f6c3f225abcca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2175103
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shadow buffers help reduce the latency of glMap* operations
at the cost of CPU overhead. It might not be desirable to
incur such an overhead for all usecases. Featurize it but
enable it by default.
Bug: angleproject:4339
Change-Id: I6374618bf99677eef55fd50a139fb86f5ea70791
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278102
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
When TSAN is enabled, it catches some bad memory access in the NVIDIA
driver on Linux during glLinkProgram with multithreaded linking.
To workaround this, assume we don't have native support for
KHR_parallel_shader_compile
Bug: chromium:1094869
Change-Id: I92f042b39028df108de2c5378311cc0c7b683e08
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2250938
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Add the ability to release and reacquire the high-power GPU, and to
respond to changes in the active GPU. In Chromium, the GPU process can
not access the WindowServer. An external process must inform ANGLE
that the active GPU has changed, and that ANGLE should switch its
internal context to the new GPU.
Incorporates a couple of functions from WebKit, used with permission,
to effect this GPU switch.
A follow-on change in Chromium which uses these new APIs will make the
existing dual-GPU tests pass with ANGLE and the passthrough command
decoder.
Carry forward Chromium's workaround of disabling GPU switching on
older MacBook Pros to ensure stability.
Document the process of adding new EGL extensions to ANGLE.
Bug: chromium:1091824
Change-Id: I499739156e851b493555d4d6e4aef87d8b97fa31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240638
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Use BlitGL to reimplement copyTex[Sub]Image2D on iOS.
Bug: angleproject:4674
Change-Id: Ie3018d6d33da57797162922410f76557124df4b6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2222718
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mac drivers generate mipmaps in linear color space. To work around
this, copy the sRGB texture to a linear texture, generate mipmaps
and then copy back.
TEST=conformance2/textures/misc/tex-srgb-mipmap.html
BUG=angleproject:4646
Change-Id: I8675d0ab004bcd2985f685d64cbb84deff5f1c86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211083
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
"platform.h" is too common a name and causes headers to be
included incorrectly. Disambiguate the header using a more
specific name.
Solves a problem that came up with the GLES 1 tests and the
standalone test harness.
Bug: angleproject:3162
Change-Id: I88229a2c9407e0db57f5beee44daa11a4075f700
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2229065
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This CL adds a new attribute that helps to identify
lower platform angle should use. We identified
several different use cases that ANGLE must
comply with when choose a display implementation.
Please refer to the
Support Matrix for EGL_ANGLE_platform_angle table
Bug: chromium:1084458
Change-Id: I6ea3d5081012ddf450f1c641343d1ba1a673483b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2210151
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Fixes an implied dependency cycle between translator and angle_common. This will also allow us to be more strict about declaring dependencies on GLSLANG headers.
Tested by building and running angle_unit_tests on Linux.
Bug: angleproject:4672
Change-Id: I331230d2cf179ccea140ee7a0d5a3c8768c58cb1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2222682
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
There is a driver bug in VMWare drivers related to timer queries.
This driver is already disabled in Chrome, this CL ports the
workaround to ANGLE.
Bug: chromium:1075876
Bug: chromium:811661
Change-Id: I87ab28b803191884658d0c1ad4bfdfdd1b727fd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219420
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Created new CommandProcessor class that can be run as a worker thread.
Running CommandProcessor within RendererVk as a worker thread that
takes a CommmandBufferHelper (CBH) ptr as the interface and processes
that CBH into a primary command buffer.
Main thread has a queue of CBH to draw from. After submitting a CBH to
the worker, it pulls next CBH from the queue. Worker thread releases CBH
back to the main thread queue when done.
Synchronization goes two ways:
1. Work submitted to worker thread is managaed with a mutex and
condition variable based around the work queue.
2. Available CBH ptrs for the main thread have a mutex and condition
variable that manages the CBH queue.
The worker thread is disabled by default, and, when enabled, it will
currently behave and perform as the non-threaded code. This is because
the kNumCommandBuffers const in ContextVk.h is set to 2. With only 2
command buffers, they will be assigned to the inside and outside
RenderPass command buffers respectively. Then, as soon as one is
submitted, the main thread will stall waiting for it to be completed
and put back into the queue mentioned in #2 above.
The next step is to move command submission to the worker thread and
update the number of command buffers so that processing/submission
will occur in parallel with the main thread. Right now there is a
race condition issue when attempting to run in parallel because the
main thread updates and submits the same primary command buffers
that are used in the worker thread, which is in violation of the
Vulkan spec.
The follow-on CL will fix this issue as the main thread will only
touch SecondaryCommandBuffers and the worker thread will be the
only thread touching the primary command buffers.
Bug: b/154030730
Change-Id: Ib0c518bbd7ca9a3a7e789f4e1f2f7131ddc0509e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174719
Commit-Queue: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
GL_OES_texture_cube_map_array is core in 3.2. This CL adds support
for this extension in the shader translator.
Now passes dEQP.KHR_GLES31/core_texture_cube_map_array.*,
dEQP.GLES31/functional_fbo_color_texcubearray_*, and
dEQP.GLES31/functional_opaque_type_indexing*samplercubearray* with GL backend.
Bug: angleproject:3584
Change-Id: I1a8485c7d9d3fffb9b5109d292b35b0c56a3c665
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133086
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
vkCmdPipelineBarrier call
Nvidia preferes one barrier call than multiple calls with fine grained
stage dependency information. They do not care much about stage
dependency. This adds a feature flag that sets to true on nvidia and
will merge all barriers into one call.
Bug: angleproject:4633
Change-Id: I204484aa4c5989655f74d70a0eaa235c3c83f548
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2207635
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
This is a reland of 38780ae392 modulo the
changes to disable VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, as
this was causing problems. With this landed, the extension will not work
on SwiftShader until we find a way to allow this extension through the
validation layers.
Bug: b/146423360
Bug: b/154620295
Change-Id: Ie09fc507c01a47be3bb227bc78771660170ba5d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2199639
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Add EGL_TEXTURE_OFFSET_X_ANGLE and EGL_TEXTURE_OFFSET_Y_ANGLE attributes
to EGL_ANGLE_d3d_texture_client_buffer which are used to specify offsets
used for rendering into the pbuffer surface backed by a D3D11 texture.
Rendering with the correct offset is needed when Chrome gets a texture
and offset from an external source e.g. when calling BeginDraw() on
IDCompositionSurface.
Bug: angleproject:2997
Change-Id: I363f739f3f05c38720f385e34c91e98fc6a622a0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186176
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
This reverts commit 38780ae392.
Reason for revert:
Breaks SWANGLE-VK:
05-12 23:42:28.612 22836 22861 D libEGL : dlopen_ext from APK (libEGL_angle.so) success at 0x79f4485a10
05-12 23:42:28.617 22836 22861 D libEGL : dlopen_ext from APK (libGLESv1_CM_angle.so) success at 0x79f4485eb0
05-12 23:42:28.619 22836 22861 D libEGL : dlopen_ext from APK (libGLESv2_angle.so) success at 0x79f4485c60
05-12 23:42:28.624 14223 14223 D StatusBar: disable<e i a s b h r c s > disable2<q i n >
05-12 23:42:28.633 14014 14057 V DisplayPowerController: Brightness [0.19986142] reason changing to: 'automatic', previous reason: 'automatic [ dim ]'.
05-12 23:42:28.635 22836 22861 D vulkan : searching for layers in '/data/app/~~0AfWfBsFEO78tqKlnanevg==/org.khronos.gl_cts-NOs3SGclHqlbcqe-08gHrw==/lib/arm64'
05-12 23:42:28.635 22836 22861 D vulkan : searching for layers in '/data/app/~~0AfWfBsFEO78tqKlnanevg==/org.khronos.gl_cts-NOs3SGclHqlbcqe-08gHrw==/base.apk!/lib/arm64-v8a'
05-12 23:42:28.632 22836 22836 W .khronos.gl_cts: type=1400 audit(0.0:218): avc: denied { ptrace } for scontext=u:r:zygote:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=0 b/77925912 app=org.khronos.gl_cts
05-12 23:42:28.636 14014 14034 I EventSequenceValidator: Transition from ACTIVITY_LAUNCHED to ACTIVITY_FINISHED
05-12 23:42:28.637 22836 22861 F SwiftShader: external/swiftshader/src/Vulkan/libVulkan.cpp:425 vkCreateInstance TRACE_ASSERT: pCreateInfo->pNext sType = 1000247000
--------- beginning of crash
05-12 23:42:28.637 22836 22861 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 22861 (.khronos.gl_cts), pid 22836 (.khronos.gl_cts)
Original change's description:
> Add support for GL_CHROMIUM_texture_filtering
>
> Chromium enables a custom extension, GL_CHROMIUM_texture_filtering, when
> using SwiftShaderGL, to enable high precision filtering. This change
> makes it so ANGLE also handles this same extension when using the
> SwiftShaderVK backend, by enabling the new
> VK_GOOGLE_sampler_filtering_precision custom extension.
>
> Bug: b/146423360
> Bug: b/154620295
> Change-Id: I69cafc1ccf5970a3d220ac7e13ec3c8fdd4a9643
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2185822
> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
TBR=geofflang@chromium.org,jmadill@chromium.org,amaiorano@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: b/146423360, b/154620295
Change-Id: I803d7a7baac81cf178b59c4bf2789346ec1d3f87
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2197168
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
Chromium enables a custom extension, GL_CHROMIUM_texture_filtering, when
using SwiftShaderGL, to enable high precision filtering. This change
makes it so ANGLE also handles this same extension when using the
SwiftShaderVK backend, by enabling the new
VK_GOOGLE_sampler_filtering_precision custom extension.
Bug: b/146423360
Bug: b/154620295
Change-Id: I69cafc1ccf5970a3d220ac7e13ec3c8fdd4a9643
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2185822
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
OpenGL state sync issues as few GL commands as possible to update the
blend state regardless of an application input.
Enhanced ClearTestES3.MaskedIndexedClearMultipleAttachments
regression test.
Disabled OES_draw_buffers_indexed on Windows/AMD/OpenGL.
Bug: angleproject:4394
Change-Id: I244ac2975678bc559634152cf4eb997d9dbe83d0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2145874
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Check the following -
1. Vulkan ICD supports VK_KHR_external_fence_fd
2. ExternalFenceProperties and ExternalSemaphoreProperties
support Android FD.
eglCreateSync - if FD was provided import to VkFence,
else create VkFence with new FD and then
flush and submit VkFence on next vkQueueSubmit.
eglGetSyncAttrib - for status call vkGetFenceStatus.
eglDupNativeFenceFdANDROID - return FD from vkGetFenceFD call.
eglClientWaitSync - call vkWaitForFences.
eglWaitSync - dup FD, create VkSemaphore and import FD, then
flush() and add VkSemaphore to next vkQueueSubmit
as a waiting semaphore.
Extended end2end test suite with nativefence test cases.
Bug: angleproject:2517
Test: angle_end2end_tests --gtest_filter=EGLSyncTest.AndroidNativeFence_*
Change-Id: I8f6a6f4c3d71d83007f662b78377aa015a740035
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2026177
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
- Built-in variable gl_ClipDistance has been added to compiler.
- Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable
each gl_ClipDistances[i] works out of the box via glEnable().
- Vulkan/Metal: Use uniform variable to control writing to each
gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance
array. The writing to the disabled element in vertex shader will be
ignored, and turned into zero assignment instead.
- Direct3D/Mobile GL: Not implemented yet.
- Added ClipDistanceTest to gl_tests and compiler unittests.
- GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so
GL_EXT_clip_cull_distance could be implemented in future if needed.
Bug: angleproject:4452
Change-Id: I571ac8b56826989808a680226a04bec4cf59988e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The VMA allocator has a handy feature where during memory
allocation we can request persistently mapped memory.
This saves IOCTL overhead for apps that update buffers
frequently.
Bug: angleproject:2162
Change-Id: I870d880033beec343efae6de06f1c5935de4c2c1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2155131
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Tobin Ehlis <tobine@google.com>
This workaround is needed when the GL driver is less than 4.3 (all
MacOS). The driver will generate many errors during execution without
this enabled which blocks GL driver error checking.
Add additional workarounds for Intel drivers that need a sufficiently
large primitive restart index when doing DrawArrays calls.
BUG=angleproject:3997
Change-Id: Idd293ff1dbc0a3609b11ea1d6b30da0a99e8f5c5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2141714
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Checks if early fragment tests as an optimization is feasible and enable
it if we can. In the link time, if context state diagrees with
optimization (in rare case), then remove the
ExecutionModeEarlyFragmentTests sprv op code.
Bug: angleproject:4508
Change-Id: Ifbb06c0ffb050a9f3ddb16ab50362e908b4b9cf6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2136490
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Since it's returned by eglQueryStringiANGLE, and the doc says:
1. eGLQueryStringiANGLE returns a pointer to a static, null-terminated string
2. On failure, NULL is returned
So, we shouldn't be returning NULL when there is no failure.
This was breaking 'chrome --enable-gpu-service-logging'.
Bug: angleproject:3947
Change-Id: I2dcc7d479899dc1fc5fd59a502e84defe44f64c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2137939
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Added support for GL_NV_shader_noperspective_interpolation on
the Vulkan and Desktop OpenGL backends
Bug: angleproject:4388
Test: angle_end2end_tests --gtest_filter=ShaderInterpTest.NoPerspective/*
Change-Id: I12473830c0ea8b4fffeae9c4a8ec92d979c8e18c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2107234
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
eglGetMscRateCHROMIUM was added to EGL_CHROMIUM_sync_control based
on the original extension GLX_OML_sync_control. However, this new
function is not universally implemented. This CL moves it to a new
extension, EGL_ANGLE_sync_control_rate, and renames it to
eglGetMscRateANGLE.
Bug: chromium:1064078
Change-Id: Ia2a29c6776b2b2bf2b98e58ee83b5f141ed01301
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2118154
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
This should enable some cases of limited support for feedback loops
with depth/stencil buffers. For example with Manhattan and the Vulkan
back-end.
Increases the number of RenderPasses in Manhattan slightly. This will
regress performance slightly until we can work out a better solution
that is also conformant with the spec.
Bug: angleproject:4517
Change-Id: I2758e6b4c2a930474c09cdc0950f3b6c34541089
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2106670
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Enables the translator to handle non-constant global initializers in
all essl versions iff the shader enables the extension to do so.
Bug: angleproject:4468
Test: angle_end2end_tests --gtest_filter=ShaderNonConstGlobalInitializerTest.*
Change-Id: I8f138c12fc83d2f38ff8f45ca9133222b01e4087
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102959
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
This is a reland of 7455b54401
Original change's description:
> Instantiate rx::DisplayEGL when device type EGL is selected
>
> Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be
> used to request a driver egl-backed implementation with ANGLE.
>
> Bug: angleproject:4328
> Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038
> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Bug: angleproject:4328
Change-Id: I4e997c4fa1b5b59f081436f05bd208303ffe38e9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2093412
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Julien Isorce <julien.isorce@chromium.org>
This reverts commit 7455b54401.
Reason for revert: This appears to break the "Linux FYI Ozone (Intel)" bots on the chromium.gpu.fyi waterfall. Ozone means ChromeOS.
Original change's description:
> Instantiate rx::DisplayEGL when device type EGL is selected
>
> Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be
> used to request a driver egl-backed implementation with ANGLE.
>
> Bug: angleproject:4328
> Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038
> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=geofflang@chromium.org,syoussefi@chromium.org,jonahr@google.com,julien.isorce@chromium.org
Change-Id: I8aec6c2783b0acb67d3315d351cdc9e526f58d6b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:4328
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2091864
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Ian Elliott <ianelliott@google.com>
Currently still ignoring precision qualifiers for Vulkan shaders by
default, but have added feature "enablePrecisionQualifiers" that can be
enabled in order to include precision qualifiers.
With this initial implementation, it's possible to get precision
qualifier mis-matches in the generated GLSL 4.50. According to the
spec this is allowed. From GLSLangSpec 4.50 section 4.7 "Precision and
Precision Qualifiers":
For the purposes of determining if an output from one shader stage
matches an input of the next stage, the precision qualifier need not
match.
However, when converted to SPIR-V and run through the shader validation
any mismatches will cause shader validation errors. Initially just
ignoring those errors with this commit.
Bug: angleproject:3078
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057749
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tobin Ehlis <tobine@google.com>
Change-Id: Ieecca604bb2c834c9b1c2bcab85279d1f8755dfa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2086280
Define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE that should be
used to request a driver egl-backed implementation with ANGLE.
Bug: angleproject:4328
Change-Id: I6871d3a27e2bfc02af9815dcf86ae1cb6524f0cc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030038
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This entry point is specifically for retrieving very large timestamp
values from EXT_disjoint_time_query. In GLES 2.0 contexts with the
Vulkan back-end we were getting some astronomical values that couldn't
be cast to 32-bit ints.
Also fix missing dependencies in generate_loader.py.
Bug: angleproject:4433
Change-Id: I59146dcc1a163a24ac2d7c37546f4551a7a8890a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080595
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
This extension allows setting independent blend state (and color write mask) for each draw buffer. OES and EXT versions provide exactly the same functionality. It is also included in GLES 3.2 core.
Bug: angleproject:4394
Change-Id: I0c27c419472622e309a038dd1463fa0b3e4ca595
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2078587
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Currently hitting a crash on Apple so disabling FramebufferVk cache.
Bug: angleproject:4442
Change-Id: I3824252210aeeaf9919c8d17730395b394a50862
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080661
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Tobin Ehlis <tobine@google.com>
Includes a new entry point needed for disjoint timer queries. This
header is copied exactly from Khronos's official repo. We add one
change so that we can include special ANGLE modifications in
gl2ext_angle.h.
Bug: angleproject:4433
Change-Id: I6c9cbdfa73ca3de052ff49c5ea91eb5e9a9ee699
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080596
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
As an Android GLES driver on top of Vulkan, ANGLE must pre-rotate
rendering on behalf of the application. This involves modifying the
vertex shader to multiply gl_Position with a mat2 "rotation matrix".
Not doing so means that SurfaceFlinger (SF) will perform a costly
rotation blit before presenting every image. Setting
WindowSurfaceVk::mPreTransform to mCurrentTransform tells SF to not do
the blit.
When the surface is rotated 90 or 270 degrees, the width and height
must be swapped for:
- The swapchain images, and for any depth, stencil, and/or multisample
attachments used with the swapchain image.
- The viewport, scissor, and render area.
Because the Metal back-end shares the TranslatorVulkan, it will define
the same preRotation (mat2) DriverUniform that is used for Vulkan.
Bug: angleproject:3502
Change-Id: I968dbe8869ba0f50de18dd41f1195e847c06b545
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2038272
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
We would often pad incorrectly given the constraints of the max stride.
We shouldn't really be rounding up the buffer size, but we should
instead be adding the max alignment size to the end of the buffer.
Bug: angleproject:4428
Change-Id: Id2afc572c85985548a18f60b42cdc388d83d5c4c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2071235
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Implement import of fuchsia external objects passed by zircon handle. This
works exactly the same as with file descriptors.
Bug: angleproject:3492
Change-Id: I4d46917dfc5902f00c94550158a9f8073097f0a4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642334
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Also updates relevant comments to no longer refer to a graph.
Bug: angleproject:4029
Change-Id: Ic29716e9ae4926870f902947d49d8fee7af98662
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057804
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Only enabled for specific tests at the moment. This CL allows our tests
to sanitizes memory for the robust resource access extension. It is
quite slow so should not be enabled by default.
Only works for 1 level 2D color textures and buffers. Makes several
flaky robust resource initialization tests consistently fail.
Controlled via an angle::Feature in FeaturesVk.
It works by initializing memory to an abitrary non-zero value:
- if newly allocated memory is mappable, we map it in init and set it
- if a buffer or texture can be a transfer destination, we use a
staging resource
- otherwise we don't attempt to initialize the resource.
Bug: angleproject:4384
Change-Id: I9b4f347bfcddf3096f491ed0243bef86837feaa0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2043271
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Add extensions layered on top of GL_EXT_memory_object and GL_EXT_semaphore
to support GL & Vulkan interoperation on Fuchsia. They are analagous to
the file descriptor versions, except not quite as opaque.
This is a draft; the underlying vulkan extensions have not been submitted
to Khronos.
Bug: angleproject:3492
Change-Id: Ic4723ded9fff752c4186eaa6a7f07d9ac51a3364
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642332
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Prior to this commit, when "OpName %id name" was encountered, the info
corresponding to "name" was immediately associated with %id. This is
not necessarily correct because there could be multiple ids with the
same name. For example a sampler declaration and an unrelated function
argument could have the same name. In this case, the sampler
declaration and function argument name don't even need to be in the same
shader stage.
This change modifies the SPIR-V transformation such that the name-id
mapping is tracked until the OpVariable instruction that actually
declares the variable is visited. The mapping to variable info is only
done if the storage class specified in this instruction corresponds to a
shader interface variable.
Bug: angleproject:3394
Change-Id: I35a1f6f8278e4b1ad81c9955a55e1b72d6f2e4ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057248
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Implement an IOSurface-backed pBuffer surface for the Vulkan backend
on Mac, through SwANGLE. ANGLE will pass a raw pointer to Swiftshader
and handle locking/unlocking the IOSurface.
Bug: chromium:1015454
Change-Id: Ia3ead55334736003d405b54ba8dcc7701706fbb2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965434
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
We no longer need this workaround. Also mCommandPoolFreeList dead code.
Bug: angleproject:3508
Change-Id: Ib73ddd431eb1bf9a55c3421111af4df5976cc1fb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033485
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Commit-Queue: Tobin Ehlis <tobine@google.com>
This workaround was added due to qualcomm driver bug b/129281932. But
this has been fixed with recent drivers. Removing the WR here so that it
will not negatively affect performance.
Bug: angleproject:4344
Change-Id: Iea2ec86082a0ced64bfe843bf916c6bdb2aea60b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2029210
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Joint work with syoussefi@, who wrote the RewriteRowMajorMatrices
pass, and revised it for this CL to not rely on the
NameNamelessUniformBuffers pass - which was breaking it on the GL
backend.
Hook up previously written RewriteRowMajorMatrices transformation, and
enable on all GPU types on macOS. It is needed at least for AMD and
Intel GPUs.
Add a new test which verifies the behavior of dynamically-indexed
arrays of row-major matrices.
Bug: angleproject:2273
Bug: angleproject:3843
Change-Id: Id582f9cf6b9b1a59091aab1786539174f360b705
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2008717
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Remain the old hardware requirement for turning on clampArrayAccess. But
also turns it on universally for WebGL context. So that we won't suffer
from clampArrayAccess not handled properly on some compute shader deqp
tests.
Bug: chromium:1042252, angleproject:4361
Change-Id: Ib11affd6df27ce7d2100980d2b8decdee36876e8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2026029
Reviewed-by: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
The shader translator outputs arbitrary location indices. Once compiled
by glslang, the SPIR-V transformer modifies these decorations. If the
transform feedback extension is used, it will also add the relevant
decorations to the varyings that are captured.
Bug: angleproject:3394
Change-Id: I5ecafd0536408612a5d4b920dbabbfabe650657c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2008468
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This change introduces a SPIR-V transformer that modifies shader
interface variable decorations directly in SPIR-V instead of
manipulating the input GLSL. Currently, descriptor set and binding
indices are set by the transformer.
The shader translator outputs arbitrary set and binding indices. Once
compiled by glslang, the SPIR-V transformer modifies these decorations.
The ultimate goal is to be able to modify the SPIR-V again when program
pipeline objects decide a different set/binding is necessary.
Bug: angleproject:3394
Change-Id: If358265a72bf1fe9f5676562b39a632cb2e05dc4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2001477
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
When ANGLE is using the GL backend on GLX, we can expose
eglGetMscRateCHROMIUM via glXGetMscRateOML. Otherwise, this function
should return false.
Bug: chromium:1042393
Change-Id: Id9b308c2217e07ee9860e2869be0e23b7a0c7411
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2017048
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
In preparation for compiling shaders early at link time, this change
reworks line raster emulation such that it uses specialization constants
instead of a preprocessor condition. This means drawing both triangles
and lines with this program will still result in a one-time shader
compilation.
The compilation is still done at draw time in this change.
Bug: angleproject:3394
Change-Id: I0bf91398868d7f7147456533b728906b505192b2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1992365
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This uses the EGL_ANGLE_feature_control extension through the test
harness to control feature selection via a test config. This obviates
the need for the hacky platform methods table override.
Also adds a command graph feature that will be used to prototype the
command graph linearization for Vulkan.
Bug: angleproject:4029
Change-Id: Id37fadd5d2c317c9d9dd90dfab1fdc8e4ac3701f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2007612
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Originally authored in the WebKit repository:
https://bugs.webkit.org/show_bug.cgi?id=205618
Has been tested with WebKit's WebGL backend on top of ANGLE inside the
iOS Simulator. TODOs will be addressed in forthcoming CLs.
Bug: angleproject:4263
Change-Id: Ic879866aaee5f933599d956b0646d0c01db55d0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1995824
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Under robustBufferAccess, Vulkan states that:
Vertex input attributes are considered out of bounds if the offset of
the attribute in the bound vertex buffer range plus the size of the
attribute is greater than either:
- vertexBufferRangeSize, if bindingStride == 0; or
- (vertexBufferRangeSize - (vertexBufferRangeSize % bindingStride))
The latter implies that if the buffer size is not a multiple of the
vertex attribute stride, what lies beyond the last multiple of stride is
considered out of bounds.
It also says:
Out-of-bounds buffer loads will return any of the following values:
- Values from anywhere within the memory range(s) bound to the buffer
(possibly including bytes of memory past the end of the buffer, up to
the end of the bound range).
- Zero values, or (0,0,0,x) vectors for vector reads where x is a valid
value represented in the type of the vector components and may be any
of ...
The first bullet point indicates that the driver is allowed to load the
attribute values from the buffer if its range still lies within the
buffer size.
Take the following example:
- Buffer size = 12
- Attribute stride = 8
- Attribute offset = 0
- Attribute size = 4
Basically the buffer is thus laid out as follows:
attr stride
_________/\_________
/ \
+----------+----------+----------+
| vertex 0 | padding | vertex 1 |
+----------+----------+----------+
\___ ____/
V
attr size
In the above example, the attribute for vertex 1 is considered out of
bounds, but the driver is allowed to either read it correctly, or return
(0, 0, 0, 1) for it.
Most drivers implement the former, while AMD implements the latter.
This change introduces a workaround for AMD where
GL_MAX_VERTEX_ATTRIB_STRIDE is limited to 2048 (the common value for it
according to gpuinfo.org) and conservatively rounds up every buffer
allocation to that size.
While technically, this workaround should be applied on any device with
the robustBufferAccess feature enabled, it is currently limited to AMD
to avoid the inefficiency. A possible future revision of Vulkan may
relax the above restrictions.
Bug: angleproject:2848
Change-Id: Ida5ae5d777da10f22ce8be5a09a7644b5bbd778e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1991709
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
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>
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>
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>
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>
fxc exhibits slow compile performance with dynamic cbuffer indexing.
So when a uniform block contains only one large array member, which is
an array of structures, translate this uniform block to
a StructuredBuffer instead.
Bug: angleproject:3682
TEST=angle_end2end_tests.UniformBufferTest.*
Change-Id: Ife80dba8aae65b761737e095895e00a570230f88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1782046
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
WEBGL_video_texture is an extension that will improve uploading video frame to WebGL performance.
(https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/)
This extension introduced a new texture type TEXTURE_VIDEO_IMAGE_WEBGL and a new sampler type
samplerVideoWEBGL to sample it.
In chromium implementation, TEXTURE_VIDEO_IMAGE_WEBGL maps to different native texture type
based on platform. On desktop, it maps to GL_TEXTURE2D(Currently supported). On Android, it
should map to GL_TEXTURE_EXTERNAL(TODO). SamplerVideoWEBGL needs to be mapped to sampler2D or
samplerExternalOES according to TEXTURE_VIDEO_IMAGE_WEBGL implementation.
This patch implements samplerVideoWEBGL in Angle to support WEBGL_video_texture on desktop. In
this case, samplerVideoWEBGL should map to sampler2D.
Bug: chromium:776222, angleproject:3889
Change-Id: Idb0a5fcde37ca75ccc1181226b91f257212e7500
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866274
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
The precise keyword is used in tessellation shaders but introduced in
this extension.
EXT_gpu_shader5 introduces a handful of features to shaders. This
change only implements the `precise` keyword.
Bug: angleproject:3569
Change-Id: I2252b79098eb8ba2d2faa040d7eaed7548b7051e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939851
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Chrome has a --disable-gpu-driver-bug-workarounds flag that needs to be
able to be forwarded to ANGLE
Bug: 1016377
Change-Id: Ied6c8656742e25c32d508b8bfe76a902d82bcf93
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1925249
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This patch ports all the Intel-related shader workarounds defined in
gpu_driver_bug_list.json used by Chromium validating command buffer
into ANGLE so that they can also take effect in Chromium passthrough
command buffer.
Bug: 1020467
Bug: 642605
Bug: 403957
Change-Id: I8e4866fc34d5e8f1b2f4dbfa8e526b80249ba166
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1889386
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Clamps the vertex position to the subpixel grid before interpolation.
This will give more correct results on systems that have less than
8 bits of subpixel accuracy.
Also uses a more accurate formulation for the emulation filter in the
fragment shader using dfdx and dfdy.
Fixes line raster CTS tests on SwiftShader. Still does not produce spec
conformant lines. Updates the public docs to indicate this.
Bug: angleproject:2830
Change-Id: Ib9a268df3e7d986bd2b1348be664389fe8fc0ef2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1826598
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This replaces passing gl::Context. Using a gl::State directly will more
easily let the mid-execution replay code pass a mocked gl::State
instead of having to modify the real underlying Context state. For
example when capturing pixel pack and unpack parameters the states
could not be overridden without changing the gl::Context itself.
Similarly when capturing client side data.
Also moves a query parameter info function into queryutils so it can be
accessible to the State-based capture.
Refactoring change only.
Bug: angleproject:3611
Change-Id: I3c064001cfa83ebbb67a2b8fc8b6180491edd215
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1899728
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This CL adds two new extensions:
* EGL_ANGLE_ggp_stream_descriptor:
Introduces a new attribute to CreateWindowSurface. Allows the app
to pass in a stream descriptor to VkCreateSurfaceKHR.
Mirrors VK_GGP_stream_descriptor_surface.
* EGL_ANGLE_swap_with_frame_token:
Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This
allows the app to pass a GGP frame token down to vkQueuePresentKHR.
Mirrors VK_GGP_frame_token.
Bug: angleproject:4078
Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Functions have to be added to the end of the list to prevent breaking
EGL on Android.
Bug: angleproject:2634
Change-Id: I19705144d8ab873c13891038f840b9fc96a79103
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897646
Commit-Queue: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
To match the parameter order of MultiDraw* calls.
And potentially expose in chromium directly with ANGLE_ prefix.
Bug: angleproject:3402, chromium:891861
Change-Id: I19548f4c3c7faa422e43905850b218039de43015
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1894241
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Added support in ANGLE for the provoking vertex feature,
which allows to choose the provoking vertex convention
(first or last) for flat shading.
Just copying the vk_ext_provoking_vertex.h file into ANGLE src tree for now.
When the extension lands in the vulkan header we'll migrate to that and remove this
file from ANGLE.
With this, all these tests pass with SwANGLE:
dEQP-GLES3.functional.fragment_out.* (fixes 526 failures)
dEQP-GLES3.functional.rasterization.flatshading.* (fixes 6 failures)
dEQP-GLES3.functional.shaders.linkage.varying.* (already passing before, still passing)
Bug: angleproject:3430
Bug: angleproject:3677
Bug: angleproject:4063
Change-Id: Icc361f567072c12472398e37a94a61d7f95007ad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1855681
Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Reviewed-by: Alexis Hétu <sugoi@chromium.org>
Both Qualcomm and SwS require forceOldRewriteStructSamplers to be
enabled, so this change will enable that feature for all of Android.
We aren't sure yet why this is required for SwS also, but that will be
chased as part of issue 2703.
Bug: angleproject:4045
Change-Id: I83b2ac18e0111ed35438ffd457bfe120911a7767
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879711
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Will be used for mid-execution capture. Only has a
stubbed-out implementation right now.
Bug: angleproject:3944
Change-Id: I6ddae07907ecbdbd3be9a5d2d3fcafeb425445e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1878888
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
The original driver bug no longer exists after upgrading the bots. This
workaround has the side effect causing the bug 3867.
Bug: angleproject:3407
Bug: angleproject:3867
Change-Id: I64f2e41729f209a1cef5ba49140650207666992c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1870845
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This is a workaround for the webgl2 conformance test case
WebglConformance_conformance2_glsl3_vector_dynamic_indexing_swizzled_lvalue.
Dynamic indexing of swizzled lvalue like "v.zyx[i] = 0.0" is problematic on
various platforms. This removes the indexing by translating it this way:
void dyn_index_write_vec3(inout vec3 base, in int index, in float value){
switch (index) {
case (0):
(base[0] = value);
return ;
case (1):
(base[1] = value);
return ;
case (2):
(base[2] = value);
return ;
default:
break;
}
if ((index < 0))
{
(base[0] = value);
return ;
}
{
(base[2] = value);
}
}
...
dyn_index_write_vec3(v.zyx, i, 0.0);
...
Bug: chromium:709351
Change-Id: I971b38eb404209b56e6764af1063878c078a7e88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869109
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
PRIMITIVE_RESTART_FIXED_INDEX isn't available until desktop GL 4.3. When it is
not available, emulate it by enabling PRIMITIVE_RESTART and set the primitive
restart index before each draw call based on the index type.
TEST=deqp/functional/gles3/primitiverestart/*
BUG=angleproject:3997
Change-Id: Id736f1056cb07da91c6d592693406333142e6265
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1853885
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
ARB_texture_rectangle is the only currently supported disablable
extension. This allows us to use ARB_texture_rectangle in WebGL
implementations without exposing it to WebGL user shaders.
Bug: angleproject:3956
Bug: angleproject:3770
Change-Id: I80b10d2e9c9feebe545ce15195721487165ecc51
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1838418
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This is a combination of:
- Changing the "scripts/generate_entry_points.py" script to tell it to
also auto-generate GLES 3.2. Also changing "scripts/gen_proc_table.py".
- Generating new and modified files needed to add GLES 3.2 to the
ANGLE front-end. This is done by running the following command:
"python scripts/run_code_generation.py".
- Creating the following files:
- src/libANGLE/validationES32.h
- src/libANGLE/validationES32.cpp
- src/libANGLE/capture_gles_3_2_params.cpp
- Hand-editing the following files:
- src/libGLESv1_CM/libGLESv1_CM.cpp
- include/GLES2/gl2ext_angle.h
- src/libGLESv2.gni
- src/libANGLE/Context.h
- src/libANGLE/Context.cpp
- src/libANGLE/Context_gl.cpp
- src/libANGLE/ErrorStrings.h
- src/libANGLE/State.h
- src/libANGLE/validationES1.cpp
- src/libANGLE/validationGL3.cpp
- src/libANGLE/validationGL31.cpp
- src/libANGLE/validationGL32.cpp
- src/libANGLE/validationGL33.cpp
- src/libANGLE/validationGL4.cpp
- src/libANGLE/validationGL43.cpp
- src/libANGLE/validationGL45.cpp
Bug: angleproject:3649
Change-Id: I5b67f72e3e3b55e74039ec3e28aa8d399ec08cf2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1850231
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
This CL adds a new D3D11on12 device option which runs the D3D11
API on top of D3D12. This is done to aid in preliminary
investigations into the feasibility of creating a full D3D12
backend implementation.
Bug: angleproject:3919
Change-Id: I0ad4250eb3c93b0b74274c904aac74f03753c7ad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814404
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
EGL_ANGLE_platform_angle_metal is the new extension name.
Bug: angleproject:2634
Change-Id: I6ebffbd4f6d7974bc5ef6d48849e985ee83e9808
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1848793
Reviewed-by: Le Hoang Quyen <le.hoang.q@gmail.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Supports querying the CGLContextObj and CGLPixelFormatObj associated
with ANGLE's underlying OpenGL context on macOS.
Minor refactorings to implementation of device attribute queries on
all platforms.
Bug: angleproject:3973
Change-Id: I24341668be4cbfed0b7f2df4c1402df1effe275e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1846733
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Created a macro to help keep Features' descriptions up to date. This
will avoid confusion in the future when conditions change. Also update
all descriptions to match current state.
Bug: angleproject:3947
Change-Id: Ifc65e7789c916fab79f1323798dfb59d7a4efad2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1829584
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Re-land fixes Win7 configs and placement of the SwiftShader module for
ASAN/TSAN configs.
Adds a new EGL extension for picking SwiftShader when using the Vulkan
back-end. Also cleans up ICD enabling code RendererVk. Also includes a
change to a buffer size necessary to support SwiftShader's minimum
limits.
Bug: angleproject:3876
Bug: b/140251624
Change-Id: I5e16057ac4de07bbdbbd248542b1b9103133294f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1810065
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
DXT1 has a specific 'BLACK' code that results in transparent black pixels when
sampled. D3D does not have specific RGB-only DXT1 formats like OpenGL does so
when this code is encountered, we sample 0 alpha for these pixels when GL would
expect 1 because the alpha channel should not exist.
Work around this by converting to DXT3 RGBA, adding an extra block of 1.0 alpha
pixels for each color block.
Mac Intel OpenGL requires additional workarounds to always sample 1.0 alpha.
Set the texture swizzle parameters to force it.
BUG=angleproject:3729
Change-Id: Ia3647085acd97bb01af4e95ef3f6f21dcfb6a554
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1804880
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
This reverts commit 1224802c21.
Reason for revert: https://bugs.chromium.org/p/angleproject/issues/detail?id=3912
Original change's description:
> Vulkan: SwiftShader integration.
>
> Adds a new EGL extension for picking SwiftShader when using the Vulkan
> back-end. Also cleans up ICD enabling code RendererVk. Also includes a
> change to a buffer size necessary to support SwiftShader's minimum
> limits.
>
> 32-bit is currently left disabled to work around an issue on AMD Win7.
>
> Bug: angleproject:3876
> Bug: b/140251624
> Change-Id: I33c55d994801d6154caca0cad0a608c1e808d517
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776231
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=geofflang@chromium.org,jonahr@google.com,jmadill@chromium.org
Change-Id: Id7464250f6941b0228a6b2a9bd0349823727275b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:3876, b/140251624
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808101
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Adds a new EGL extension for picking SwiftShader when using the Vulkan
back-end. Also cleans up ICD enabling code RendererVk. Also includes a
change to a buffer size necessary to support SwiftShader's minimum
limits.
32-bit is currently left disabled to work around an issue on AMD Win7.
Bug: angleproject:3876
Bug: b/140251624
Change-Id: I33c55d994801d6154caca0cad0a608c1e808d517
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776231
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Add an optional EGL_D3D11_TEXTURE_FORMAT_ANGLE attribute that is the
GL internal format to use for EGLImage being created. This will be used
for RGB emulation of swap chain texture backed WebGL contexts in Chrome
when they have alpha:false set. Without RGB emulation it is possible to
observe side-effects of the underlying swap chain being RGBA such as
reading/writing the alpha channel, BlitFramebuffer working/not working
when expected, etc.
Also document creating EGLImages from D3D11 textures in the existing
EGL_ANGLE_d3d_texture_client_buffer extension along with RGB emulation.
Bug: chromium:699566, chromium:939657
Change-Id: I4931cb7bdc46e9bc6debd56b79ecc10ea27bd78b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1777099
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
The following structs are being refactored and moved into the parent
struct ShaderVariable:
VariableWithLocation
Uniform
Attribute
OutputVariable
InterfaceBlockField
Varying
Bug: angleproject:3899
Test: CQ
Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before.
Bug: angleproject:980428
Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Windows 10 AMD drivers have also had issues with generating errors when calling
glTexImage2D with zero size after unbinding a surface.
BUG=angleproject:3859
Change-Id: Iae3e31418b6c89056d0d4aab954519598d8f25f9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1775111
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
GL_NUM_REQUESTABLE_EXTENSIONS_ANGLE had a typo between the spec and the
header but any user who used our header would still get the correct
beaviour.
BUG=angleproject:3861
Change-Id: Ibc85607ad41a8419246e057065ab4ce797f0ce66
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772376
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE,
glDrawElementsInstancedBaseVertexBaseInstanceANGLE,
glMultiDrawArraysInstancedBaseInstanceANGLE,
and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE
Workaround for OpenGL driver on Mac:
gl_VertexID on Mac with AMD GPU doesn't include baseVertex value.
So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any.
Workaround for Vulkan GLSL:
gl_InstanceIndex on Vulkan includes baseInstance. So replace
gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when
angle_BaseInstance is declared.
Bug: chromium:891861, angleproject:3402
Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Changes seamful cubemap emulation to always compute the derivative,
emulating the bias parameter by scaling the provided derivatives.
This results in more accurate mipmap levels for seams within primitives.
There are some artifacts as a result of how derivatives are calculated,
but this matches the native driver.
Bug: angleproject:3243
Bug: angleproject:3732
Change-Id: Icb976e2a7e14cb4210645571edc037d4e607bd0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754383
Commit-Queue: James Dong <dongja@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
After unbinding IOSurface textures, we reset the texture size to 0 because
some platforms don't correctly update their state tracking. This call ends
up generating GL_INVALID_OPERATION errors on Mac for unknown reasons.
Skip the call, the size reset is not required on Mac anyways.
BUG=angleproject:3859
Change-Id: I5e39b6a36aaff41082a5fcc923970f8e97774675
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769059
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Expands existing struct-sampler rewrite to flatten arrays of arrays.
This allows us to support dynamically-uniform array indexing, which is
core in ES 3.2.
Samplers inside (possibly nested) structs are broken apart as before,
and then if the type resulting from merging the array sizes of the field
and its containing structs is an array of array, the array is flattened.
Also adds an offset parameter to functions taking in arrays to account
for this translation.
As a result of outer array sizes leaking into function signatures,
functions taking arrays of different sizes are duplicated according to
how the function is invoked.
Bug: angleproject:3604
Change-Id: Ic9373fd12a38f19bd811eac92e281055a63c1901
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744177
Commit-Queue: James Dong <dongja@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This is to be able to perform validation inside TranslatorVulkan, even
if it's through ASSERTs.
Additionally, every transformation is changed such that they do their
validation themselves. TIntermTraverser::updateTree() performs the
validation, which indirectly validates many of three tree
transformations. Some of the more ancient transformations that don't
use this function directly call TCompiler::validateAST.
Bug: angleproject:2733
Change-Id: Ie4af029d34e053c5ad1dc8c2c2568eecd625d344
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1761149
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
The first parameter of glGetFramebufferParameterivRobustANGLE should be
`GLenum target`.
Bug: angleproject:3826
Change-Id: Ice4ea265389794a51838d8e61fff774c55588512
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762714
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiacheng Lu <lujc@google.com>
Games:
SkyEngine: Open source on github
The Deep Deep: Geoff's game
Bug: angleproject:3620
Change-Id: I5feee91a94648b385708cafe8d7412e86704ecd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721189
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Add a USE_SYSTEM_EGL define to allow compilation on Unix systems
without X11.
Feature detect __popcnt using Microsoft-specific _MSC_VER rather than
_M_X64/_M_IX86, which can be set by the Dinkumware stdlib on
non-Microsoft systems.
Apple's clang is too old to have -Wextra-semi-stmt
Ran generate_parser.sh using Cygwin64 bison 3.0.4, flex 2.6.4
Bug: 3439
Change-Id: Ie0d01a112a17f70ef60c120063a958b8f1a094f4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1759135
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Split from https://chromium-review.googlesource.com/c/angle/angle/+/1705035/27
This patch adds entrypoints glDrawArraysInstancedBaseInstanceANGLE,
glDrawElementsInstancedBaseVertexBaseInstanceANGLE,
glMultiDrawArraysInstancedBaseInstanceANGLE,
and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE
Implementation will come in a later separate patch.
Bug: chromium:891861, angleproject:3402
Change-Id: I18e19b850cddd79be4798b9ae7efe0680a050c7f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750125
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
"The ANGLE Project Authors"
These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.
BUG=angleproject:3811
Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
We upstreamed the changes here so it is no longer necessary to maintain
a fork.
Bug: angleproject:3706
Change-Id: I21cc63cb94f8b3603d75ce8ec86b856514a8cb5d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1749335
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
In GLSL, a cube texture is sampled with one of textureCube* functions.
This function takes a 3D coordinate which is a vector from the center of
the cube and identifies a direction to sample from. GLES2.0 has the
following table that translates this 3D coordinate (Rx, Ry, Rz) to a
face and ST coordinates within that face. This table can be found in
Section 3.7.5 (Cube Map Texture Selection).
A compiler pass is implemented in ANGLE that replaces samplerCube
declarations with a sampler2DArray. The textureCube* functions are
replaced with the corresponding texture* functions with the translated
coordinates according to that table.
Gradients provided to textureCubeGrad are translated using the same
formulae, which is not precise but the spec specifies this projection to
be implementation dependent.
Helper invocations enabled through WQM (whole quad mode) cause a
nuisance in that the extrapolated varyings used as coordinates in a
textureCube call could have a different major axis (and therefore face)
from the non-helper invocations that lie within the geometry.
subgroupQuadSwap* operations are used in conjunction with
gl_HelperInvocation to make sure the helper threads calculate texture
UVs in the same face as the non-helper invocations.
Bug: angleproject:3300
Bug: angleproject:3240
Bug: angleproject:3243
Bug: angleproject:3732
Change-Id: I0cb6a9b1f2e1e6a392b5baca1c7118ed1c502ccf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1715977
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Previously transient CommandPool is used for CommandBuffer allocation,
it is created and destroyed per frame. However, profiling found that
CommandPool destroy is very inefficient. So this commit removed the
previous logic and use two preallocated resetable CommandPools (One for
Primary and One for Secondary)
Bug: angleproject:3508
Change-Id: I8b36f2738b082811c3177935c61b10e01acb6947
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1648667
Commit-Queue: Tobin Ehlis <tobine@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The libEGL_angle.so and libGLESv2_angle.so libraries are typically
loaded into the same process each time, so we need to make sure there
aren't any duplicated symbols which could violate ODR and lead to
crashes or undefined behavior. In this case, the libEGL_angle.so
function pointer names were colliding with libGLESv2_angle.so function
names, causing crashes at runtime. The fix here is to mark the
libEGL_angle.so function pointer symbols 'hidden', so they don't appear
in the symbol table for other executables/libraries to see and can't be
overridden by other symbols.
Bug: angleproject:3751
Test: Embed ANGLE within dEQP.apk and verify no crashes
Change-Id: Ibb78369374a4a68b3489a7dd7775c52e29fa37e0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1724909
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Other small fixes for desktop compatibility
Bug: angleproject:3620
Change-Id: I8e75bce1f850fb891c8bb6e16f79302a6d59276c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707932
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
On Mac, blitFramebuffer calls fail if the source region is not enclosed
by the framebuffer. In this case, we must naively clip the source region
and adjust the dest region accordingly. This is slightly different
behavior and may cause issues with scaling so we use a separate
workaround.
Also, Windows NVIDIA has a driver bug that affects Vulkan device
creation after blitting large textures, so it should be included in the
original workaround.
This CL cleans up the workaround to use more helpers from ANGLE and to
generally improve readability.
Bug: chromium:830046
Change-Id: I50bd97449725b738036e6bd3af82362020d7eda8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713090
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
BlitFramebuffer has issues on some platforms with large source/dest
textures. As per the WebGL2 spec, this was caught with validation for
sizes over 2^32, but there is a specific issue on Linux NVIDIA where it
fails on sizes over 2^16. A better workaround (from chromium), resizes
the blitframebuffer call based on the framebuffer size.
Bug: chromium:830046
Change-Id: Ic6196db6228d0d0ac92b12a68bbced76dcbcdf8c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707115
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
This extension allows the user to specify if ANGLE should create a
context of the exact requested version or a higher version context that
is backwards compatible.
BUG=angleproject:3425
Change-Id: I7d0b75cdd7e34a2fc888aa238e1eeb67af82ae0d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601560
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
We should include logic for defining EGL prototypes when no other
preference is specified.
Bug: angleproject:3706
Change-Id: Ie1b5ea6150c7c998a9fe71cf5ee7353dca4ae7ba
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1706908
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Intel Linux graphics drivers before kernel 5.0 can hang when allocating
large textures. Limit the texture size as a workaround.
Bug: chromium:927470
Change-Id: Ic8c14235396492efafd663b1cd012fd752427992
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1700146
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
When clearing to zeros or ones on some Intel drivers on Mac, the clear color
would be incorrect.
This replicates the chromium clear_to_zero_or_one_broken workaround.
BUG=angleproject:3672
Change-Id: I0f065420b577bd8f8d931ccdbeeebdcbf9fd08d2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1692977
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reset the base level of textures before call glTexImage on Mac
to prevent driver bugs that cause texture corruption.
BUG=angleproject:3671
Change-Id: I90e94b8395a781a2142ef6be3af1d6117f084152
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1692975
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Fixes to make WGL implementation work with OpenGL tutorial
- Give directive parser the correct shader spec when on Desktop GL
- Minor changes to parse Desktop GL shaders
- Moved clientType parameter from Context to Context->mState
- Minor fixes to WGL functions
Bug: angleproject:3666
Change-Id: I01ddb828f6d581ad445f49942589436849eae5d9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1693244
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Adds support for translating gl_BaseVertex and gl_BaseInstance for implementation of
GL_ANGLE_base_vertex_base_instance.
They will only be available in WebGL 2. Since there's no gl_VertexID and
gl_InstanceID in WebGL 1. It won't be very useful to add them to WebGL
1.
Mostly follow pattern of gl_DrawID of GL_multi_draw
BUG=angleproject:3402,chromium:891861
Change-Id: Ifcd990c52d12f6814127b904e61a779b8d382e0c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666361
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Also accompanying hand edits to validationES2.cpp and
Context.cpp to allow linking.
Bug: angleproject:3188
Change-Id: I89832265092fabc71bade464f0171d65038d8b0e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1648454
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Currently ANGLE vulkan query current window size every frame to detect
whether a swapchain recreation is needed, however profiling shows some
bottle neck on window size query on X11. So here removing the per frame
window size query and only depend the result of vkAcquireImage and
VkQueuePresent to detect a need for swapchain recreation.
Bug: angleproject:3535
Change-Id: I4ddf70b973d78dfcd5f8fab28e29e802edad1b2d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1662759
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Ian Elliott <ianelliott@google.com>
Chrome used to clamp it everywhere but in practice it is only needed on
these devices.
TEST=conformance/uniforms/out-of-bounds-uniform-array-access.html
Change-Id: Idffe84023f8b27733bfda209edd59bbb220b5c0c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1680054
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
In ES 3.0 and 3.1, only non-indexed GL_POINTS, GL_LINES and GL_TRIANGLES
is supported for transform feedback. Without tessellation and geometry
shaders, we can calculate the exact location where each vertex transform
output should be written on the CPU, and have each vertex shader
invocation write its data separately to the appropriate location in the
buffer.
This depends on the vertexPipelineStoresAndAtomics Vulkan feature.
Bug: angleproject:3205
Change-Id: I68ccbb80aece597cf20c557a0aee842360fea593
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1645678
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Chrome uses regular texture uploads on all platforms except OpenGL on
Mac to do robust resource init for textures because multiple bugs have
been observed with texture corruption.
BUG=883276
BUG=882580
BUG=941620
Change-Id: I5fcd6862147822a08c7533e6a6a9277223034ebd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1669104
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Android devices will often fail to allocate textures this large and it is
prefereable to return an error from ANGLE instead of losing the context
due to an out of memory error.
This mirrors the limits Chrome applies with the max_texture_size_limit_4096
and max_msaa_sample_count_4 workarounds that are broadly applied to Android.
BUG=882580
Change-Id: I63890baa8712f13b37c607fa475432e67e9384a4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1351357
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
This workaround is always enabled in Chrome, do the same in ANGLE.
BUG=882580
Change-Id: I2c01f34a589b07bd0035d7408be884f7a51b1706
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666699
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
The Android SurfaceTexture API has to be initialized with a texture id
which Chrome has to query from an ANGLE external texture. It also
rebinds and sets the texture dimensions on calls to
SurfaceTexture.updateTexImage so ANGLE must be notified about these
changes so that state tracking and validation continue to function.
BUG=967410
Change-Id: I92e9077f75835b088da3a8caffb3ff40e9ad0361
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1630293
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Implement EGL_ANGLE_image_d3d11_texture extension. Images created with
this extension might not be renderable based on bind flags and resource
usage of the client provided texture in which case attaching them to a
framebuffer won't succeed.
The intended use case is to bind the front and back buffers of a swap
chain to GL textures that can be used for rendering in the case of the
back buffer and as a shader input for the front buffer.
Bug: chromium:939655
Change-Id: Ic3328e831880292217b88be84740740df6031fa6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1646732
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
A function was renamed which broke the platformMethods table strings.
This CL reverts the rename (originally from crrev/c/1660952)
Bug: angleproject:1621
Change-Id: I8121a4956ba1d3e3c5036f72f6f1fdf5509dc491
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1664792
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Add EGL_FEATURE_OVERRIDES_ENABLED_ANGLE and
EGL_FEATURE_OVERRIDES_DISABLED_ANGLE to submit lists of strings naming
the features that should be overridden (either enabled or disabled) on
display creation.
Bug: angleproject:1621
Change-Id: I4bb75c5dbab0e3b701a72069c38f8c60ecfffad2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1646595
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Augment the resolve shaders to be able to stretch and blit too. The
UtilsVk resolve function is accordingly expanded to include blit.
Bug: angleproject:3200
Change-Id: I30b172a5e388089735ab494f55cbfdc2781a8bf9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1635753
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
For consistency, call these ANGLE "features", a subset of which may be
workarounds. Also, whether the feature is enabled/disabled should be
publically visible as "status".
Bug: angleproject:1621
Change-Id: I0de90a932fbfe1fc9b59138153d616d29fa7268b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1643410
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Add eglQueryDisplayAttribANGLE based on eglQueryDisplayAttribEXT to add
behavior for quering the count of all workarounds available. Used
externally to build a list of workarounds.
Bug: angleproject:1621
Change-Id: I793acedc76111fd018600169d58bf5d8cf4a63ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1637817
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This extension is used to query strings from an array based on index,
which will be used to query all the information about workarounds in
ANGLE.
Bug: angleproject:1621
Change-Id: I27157f278f7f17c92c8b4fd7753e2a5ecd0528f6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1627723
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Note: Includes workaround for http://anglebug.com/3452 - some Android
devices do not indicate filtering support on VK_FORMAT_D16_UNORM.
Bug: angleproject:3103
Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTexture/*
angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.PackedDepthStencil/*
angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTextureRender/ES2_VULKAN
Change-Id: Ic325fb94ab0e619a17c2e149e0e0865fa4142f3a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575426
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Texture data corruption has been seen with this format, specifically
on AMD Radeon R7 240 cards with the 15.201.1301.0 driver.
BUG=941620
Change-Id: I42d0d86a8319afdfaf17b44e142c6414092c647d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610681
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Previously, a pass over the shader was made, converting shared and
packed interface blocks with block storage to std140. This resulted in
link success between interface blocks with different storage as they
were all translated to std140.
With this change, this pass is removed. The link step proceeds with the
block storage specifiers as seen by GLES, and only upon Vulkan GLSL
shader generation "shared" and "packed" are converted to std140.
Bug: angleproject:3199
Change-Id: I069415ab9c9b4e1034bc00f64cd2d9e2d73f5956
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1605262
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Change each workaround from a simple bool to a struct with info
including name, workaround set, description, and bug IDs. This will help
with future workaround integration with Chrome.
Bug: angleproject:1621
Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
GL_OVR_multiview functions exactly the same as GL_OVR_multiview2.
All GL_OVR_multiview2 tests now also repeat the same test using GL_OVR_multiview
Bug: angleproject:3341
Change-Id: I7e5294fb6bbf7692535174a15da6a42e1b5fc4e2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575904
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Some Vulkan drivers are not clipping rendering that is outside of the viewport,
and the Vulkan spec has some language that indicates that ANGLE should set the
scissor:
The application must ensure (using scissor if necessary) that all rendering
is contained within the render area.
In this case, ANGLE is "the application".
Bug: angleproject:3253
Bug: angleproject:3254
Change-Id: I6885a3aa6daed57f6ae1c3d974663d763cad10c9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1553973
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
Support for layout qualifiers in interface blocks are added. All
interface blocks are adjusted to either be in std140 or std430.
In the Vulkan backend, a new descriptor set is added for UBOs. A dirty
bit is added for UBO updating and pipeline layouts and descriptor
bindings are updated.
Bug: angleproject:3199, angleproject:3220
Change-Id: I271fc34ac2e1e8b76dee75e54a7cff0fe15fe4ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565061
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This is a reland of ac58e63295
The original CL was reverted in a rush because I thought there was an
uninitialized variable bug, but upon later re-review this turned out to
not be the case.
Original change's description:
> Define and expose EGL_ANGLE_power_preference extension.
>
> Allows application to select the integrated or discrete GPU on
> dual-GPU macOS systems.
>
> Tested by modifying the example program at:
> https://github.com/grorg/ANGLEIOSurfaceTest
>
> and verifying that both integrated and discrete GPUs can be selected.
> (The changes to that program will be upstreamed once some build issues
> are resolved.)
>
> Bug: 2813
> Change-Id: Ibeb17778512896456d220e9bc4cf8f222aa57057
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1570081
> Commit-Queue: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Bug: 2813
Tbr: geofflang@chromium.org
Tbr: cwallez@chromium.org
Change-Id: Iea000dd718f4f4b4f57237adb1dc44381b10106b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575419
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
This reverts commit ac58e63295.
Reason for revert: Revert on kbr's request: "has an uninitialized variable bug"
Original change's description:
> Define and expose EGL_ANGLE_power_preference extension.
>
> Allows application to select the integrated or discrete GPU on
> dual-GPU macOS systems.
>
> Tested by modifying the example program at:
> https://github.com/grorg/ANGLEIOSurfaceTest
>
> and verifying that both integrated and discrete GPUs can be selected.
> (The changes to that program will be upstreamed once some build issues
> are resolved.)
>
> Bug: 2813
> Change-Id: Ibeb17778512896456d220e9bc4cf8f222aa57057
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1570081
> Commit-Queue: Kenneth Russell <kbr@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=geofflang@chromium.org,kbr@chromium.org,cwallez@chromium.org
Change-Id: Icb936d91eec70deb825585da3ff8835ca2794736
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 2813
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575134
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Allows application to select the integrated or discrete GPU on
dual-GPU macOS systems.
Tested by modifying the example program at:
https://github.com/grorg/ANGLEIOSurfaceTest
and verifying that both integrated and discrete GPUs can be selected.
(The changes to that program will be upstreamed once some build issues
are resolved.)
Bug: 2813
Change-Id: Ibeb17778512896456d220e9bc4cf8f222aa57057
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1570081
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
This is useful for testing context lost behaviour.
BUG=angleproject:3379
Change-Id: If0e1538553b1761e313fc36ccde5138cd495200f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1566141
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
changes include:
1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change
2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported
3) WebGL 2 (ES3) is required for multiview
Bug: angleproject:3341
Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
If the vulkan driver has support for VK_KHR_external_memory_fd or
VK_KHR_external_semaphore_fd, add the GL versions of these to the vulkan
renderer's extensions.
Bug: angleproject:3289
Change-Id: I7f04b5cf883f93f6ccd579c2b75d6831b854bfd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552027
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This adds entrypoints for the Linux variants of GL_EXT_memory_object &
GL_EXT_semaphore.
Bug: angleproject:3289
Change-Id: I40de40f27aa82cd9479d5913dac0a7493919bb8f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552026
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This adds entrypoints for two new extensions that will be useful for
importing external Vulkan objects into ANGLE.
Bug: angleproject:3289
Change-Id: I206dc76eda5c6c8d836db7c6413c5544326aa722
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552024
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The Qualcomm bug workaround is changed such that clears still go through
the render pass loadOp, but the render pass is immediately closed. This
allows us to remove a few fallback methods.
Bug: angleproject:2361
Change-Id: I24c3884a183f8bb40673e922773f70faffad848f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1545524
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
On tiling GPUs, render pass loadOp and stencilLoadOp can be used to very
cheaply clear an image as it is being render to. This change uses this
feature to clear render targets when possible.
Bug: angleproject:2361
Change-Id: Ic4bdc908873f4802760d549f4893f84a47beac0f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1500576
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Enabling deqp tests previously skipped due to lack of atomic counters. Fixing
bug found in translator found by new tests.
* Switching atomicCounterDecrement from pre to post decrement
* Added 4 byte alignment check to atomic_uint offset
* Added workaround for NVIDIA D3D bug
* Added globallycoherent to atomic counters
Bug: angleproject:1729
Change-Id: If62ea003826fbe2df0834b905ff3ad7b76328399
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1480867
Commit-Queue: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This will prevent users from accidentally making semicolon errors in
the future.
Bug: chromium:926235
Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/1446493
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This extension is a subset of GL_ARB_provoking_vertex without the
QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION query.
Bug: angleproject:2829
Change-Id: I907a4d16b7b13d3bbfb948842091eedd7b6a8b77
Reviewed-on: https://chromium-review.googlesource.com/c/1410289
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This fixes a few style warnings:
* auto should not deduce to raw pointer type
* inlined virtual methods are not allowed
* non-trivial constructors and destructors should be explicit
* inlined non-trivial constructors should not be in-class
* missing override keywords
Bug: angleproject:3069
Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53
Reviewed-on: https://chromium-review.googlesource.com/c/1407640
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
This change implements glCopy[Sub]TextureCHROMIUM in GPU. As with the
previous change implementing glCopyTex[Sub]Image2D, it currently only
selects the shader path if the texture is already defined.
Bug: angleproject:2958
Change-Id: Ia1b5625f92e6c9f91807c9b601e5c34d2d5e5c30
Reviewed-on: https://chromium-review.googlesource.com/c/1392394
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
WGLWindow lets us use a Windows driver's bindings instead of ANGLE.
This only works if the underlying driver supports OpenGL ES
compatibility.
Also adds the WGL headers, WGL XML, and a specialized WGL loader.
Because of a small driver issue with NVIDIA I added a retry for the WGL
Window initialization.
Bug: angleproject:2995
Change-Id: Ie5148ece470dd03df33015f4919ad1fa79a859ec
Reviewed-on: https://chromium-review.googlesource.com/c/1366021
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL
headers.
This CL adds a dynamic loader generator based on XML files. It also
refactors the entry point generation script to move the XML parsing
into a helper class.
Additionally this includes a new GLES 1.0 base header. The new
header allows for function pointer types and hiding prototypes.
All tests and samples now load ANGLE dynamically. In the future this
will be extended to load entry points from the driver directly when
possible. This will allow us to perform more accurate A/B testing.
The new build configuration leads to some tests having more warnings
applied. The CL includes fixes for the new warnings.
Bug: angleproject:2995
Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57
Reviewed-on: https://chromium-review.googlesource.com/c/1392382
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This reverts commit 03923558a7.
Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624
Original change's description:
> Load entry points dynamically in tests and samples.
>
> This CL adds a dynamic loader generator based on XML files. It also
> refactors the entry point generation script to move the XML parsing
> into a helper class.
>
> Additionally this includes a new GLES 1.0 base header. The new
> header allows for function pointer types and hiding prototypes.
>
> All tests and samples now load ANGLE dynamically. In the future this
> will be extended to load entry points from the driver directly when
> possible. This will allow us to perform more accurate A/B testing.
>
> The new build configuration leads to some tests having more warnings
> applied. The CL includes fixes for the new warnings.
>
> Bug: angleproject:2995
> Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
> Reviewed-on: https://chromium-review.googlesource.com/c/1359516
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org
Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2995
Reviewed-on: https://chromium-review.googlesource.com/c/1392381
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
This CL adds a dynamic loader generator based on XML files. It also
refactors the entry point generation script to move the XML parsing
into a helper class.
Additionally this includes a new GLES 1.0 base header. The new
header allows for function pointer types and hiding prototypes.
All tests and samples now load ANGLE dynamically. In the future this
will be extended to load entry points from the driver directly when
possible. This will allow us to perform more accurate A/B testing.
The new build configuration leads to some tests having more warnings
applied. The CL includes fixes for the new warnings.
Bug: angleproject:2995
Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05
Reviewed-on: https://chromium-review.googlesource.com/c/1359516
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
In many places in ANGLE we need to traverse a ShaderVariable tree. We
do this to store uniform offset and other information, to flatten the
tree of uniforms for the front-end, or to produce active variable lists
for uniform and shader storage blocks. In each case, we would write
separate tree traversal code.
This patch introduces a shared visitor pattern for all of the shader
variable tree traversal instances. With that get more common code. Also
it is easier to write new variable traversals. ProgramD3D and
ProgramLinkedResources in particular get nice simplificiations.
The visitor object recieves callbacks from the traversal when entering
structs, array elements, and new variables. The visitor can treat these
differently depending on the use case. A common visitor that constructs
full variable names is used as a base class in several places.
Also moves the 'isRowMajorLayout' from sh::InterfaceBlockField to
sh::ShaderVariable. This allows us to forgo using templates in several
call sites.
Bug: angleproject:3024
Change-Id: I472d81ec775e2eee92fb3d2eb0ca83860221ba2e
Reviewed-on: https://chromium-review.googlesource.com/c/1358722
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Re-land fixes build to ensure commit_id is built before libEGL.
libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.
Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.
We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.
The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.
Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.
This CL will help us to run ANGLE tests against native drivers.
Bug: angleproject:2871
Bug: chromium:915731
Change-Id: I4192a938d1f4117cea1bf1399c98bda7ac25ddab
Reviewed-on: https://chromium-review.googlesource.com/c/1380511
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This reverts commit dd815b623e.
Reason for revert: Broke https://luci-milo.appspot.com/p/chromium/builders/luci.chromium.ci/win-rel/8006
Original change's description:
> Load correct libGLESv2 on Linux and Mac.
>
> libEGL was implicitly loading libGLESv2 on startup. This is bad
> because on platforms like Linux and Mac we could sometimes use the
> incorrect rpath. This in turn meant we needed workarounds like using
> "_angle" extensions to our shared objects to get the correct loading
> behaviour.
>
> Fix this by loading libGLESv2 dynamically in libEGL. We build the
> loader automatically from egl.xml. The loader itself is lazily
> initialized on every EGL entry point call. This is necessary because
> on Linux, etc, there is no equivalent to Windows' DLLMain.
>
> We also use an EGL.h with different generation options so we have the
> proper function pointer types. A README is included for instructions
> on how to regenerate EGL.h.
>
> The entry point generation script is refactored into a helper class
> that is used in the loader generator. Also adds the libGLESv2 versions
> of the EGL entry points in the DEF file on Windows. This allows them to
> be imported properly in 32-bit configurations.
>
> Also fixes up some errors in ANGLE's entry point definitions. Also
> includes a clang-format disable rule for the Khronos headers.
>
> This CL will help us to run ANGLE tests against native drivers.
>
> Bug: angleproject:2871
> Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
> Reviewed-on: https://chromium-review.googlesource.com/c/1370725
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org
Change-Id: I921b3c45435ab4f05cbc2d1c1172b4185d6257b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2871
Reviewed-on: https://chromium-review.googlesource.com/c/1378887
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
libEGL was implicitly loading libGLESv2 on startup. This is bad
because on platforms like Linux and Mac we could sometimes use the
incorrect rpath. This in turn meant we needed workarounds like using
"_angle" extensions to our shared objects to get the correct loading
behaviour.
Fix this by loading libGLESv2 dynamically in libEGL. We build the
loader automatically from egl.xml. The loader itself is lazily
initialized on every EGL entry point call. This is necessary because
on Linux, etc, there is no equivalent to Windows' DLLMain.
We also use an EGL.h with different generation options so we have the
proper function pointer types. A README is included for instructions
on how to regenerate EGL.h.
The entry point generation script is refactored into a helper class
that is used in the loader generator. Also adds the libGLESv2 versions
of the EGL entry points in the DEF file on Windows. This allows them to
be imported properly in 32-bit configurations.
Also fixes up some errors in ANGLE's entry point definitions. Also
includes a clang-format disable rule for the Khronos headers.
This CL will help us to run ANGLE tests against native drivers.
Bug: angleproject:2871
Change-Id: Id6ecf969308f17b1be4083538428c9c1a1836572
Reviewed-on: https://chromium-review.googlesource.com/c/1370725
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>