Includes changes from jmadill to align with Vulkan backend design.
Correctly setting layer count and depth when the texture type is
2Darray. Vulkan requires depth of 1 for 2Darray textures.
Bug: angleproject:3189
Change-Id: I0d58c33fcd75b1d768ea0308ac6e54230d8cfcc5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721169
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
When handling dirty bindings, we were treating binding indices as if
they were attribute indices, causing strange behavior. This change fixes
the dirty bit handler to use the provided index properly and update the
attributes that correspond to the binding index.
Test: ./angle_end2end_tests --gtest_filter='VertexAttributeTestES31.OnlyUpdate*/ES3_1_Vulkan'
Bug: angleproject:3598
Change-Id: I2bc3cd4da5f639a1301776fcf057a74368812c56
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1718786
Commit-Queue: James Dong <dongja@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The charts were regenerated, update the docs to point to the new charts.
Also remove some redundancy (we don't need the overview to track differences in vendors)
Bug: angleproject:3713
Change-Id: I2005031c4ca960d7f9afd80562957d31af795d61
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721190
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Translation buffers weren't being marked dirty after running a compute
shader in which they are bound as SSBOs.
This change invalidates all SSBOs after a draw or compute call.
Bug: angleproject:3739
Change-Id: I66b56df7e619b55afc7e3da6b5613b6d050e06bb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1717144
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: James Dong <dongja@google.com>
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>
The ESSL 1.0 spec is clear that "initializers must be a constant expression."
Yet, because of "legacy" applications (apparently just WebGL applications), the
code was only issuing a warning and not an error. The
"KHR-GLES2.shaders.negative.initialize" test requires an error be generated.
This change splits the semantics, allowing GLES applications to get an error,
and WebGL applications to get a warning.
Note: This change is related to https://chromium-review.googlesource.com/829138
(for angleproject:2285).
Bug: angleproject:3381
Change-Id: Ie243b7dd72102aeb52df506d121d1d2a8f6974d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1716617
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
The draw framebuffer was consulted for flipping instead of the read
framebuffer.
Revealed a bug with copy-with-transfer not taking source render target's
level/layer into account. This test was failing on Linux/Intel because
there the framebuffer is not flipped, so the transfer path was taken.
Bug: angleproject:2954
Bug: angleproject:3723
Change-Id: If95bf97b8e0536302ed39999be47bf904283c9e4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1718784
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The READ_FRAMEBUFFER_BINDING dirty bit sync was missing from copy image
functions. In the Vulkan backend, a cached value for the current read
framebuffer was used to determine if the copy should flip in Y, and that
cached value was out of date.
Bug: angleproject:3723
Change-Id: I10e8a276a42c28fbedc9939f653a5a1f4a14e87b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1715483
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Previously, all non-compressed formats were satisfied with a 4-byte
alignment. The introduction of float formats changes this.
This change calculates the necessary alignment using the same code path
as compressed formats.
Also fixes RGB9E5's pixelByte being calculated as 3 instead of 4.
Bug: angleproject:3731
Change-Id: I6abfd1c294e7f863eb99d2468eaac09e5d714039
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1715205
Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Compilation with GCC breaks as there is a build check using it.
To avoid the problem, we declare the macro HAS_BUILTIN that maps
to __has_builtin if it is defined, or 0 otherwise.
Bug: chromium:819294
Change-Id: I105d566f08baa495fccd553d7b06eb8ce36621ef
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713604
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Implements indirect dispatch for Vulkan backend. Layout of dispatch
structure is the same as OpenGL, so we pass in the buffer directly.
Test: ./angle_deqp_gles31_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES31.functional.compute.indirect_dispatch.*'
Bug: angleproject:3601
Change-Id: I94c6b1a86d3c24c1ca1bb6a78529b38909a2b91f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1710024
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: James Dong <dongja@google.com>
Merely a minor refactor to clean up the diff of a subsequent CL. In the
follow up we will also distinguish the GL extents from the Vulkan
extents/layerCount pair.
Bug: angleproject:3189
Change-Id: Ibbb79bf2e6d3f798243b424bacbfb2e5538bfecf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709755
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Need to support implicit conversions between types for GL shaders
Other small fixes to support GL shaders
Bug: angleproject:3673
Change-Id: I5341cb7195054ccc4cd36aad5dc8c801c7e1a14f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1698649
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This makes the distinction between a gl::Extents (includes a depth
value for 2D array texture layer count) and a Vulkan extents (2D array
textures have a "1" for depth) clearer. Preparation refactor patch.
Bug: angleproject:3189
Change-Id: I9a13379c421e7f3c7856ac15b7a73013258ab9fe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709754
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Vulkan doesn't treat atomic counters especially, and they are emulated
with atomic access to storage buffers.
A single atomic counter buffer binding per pipeline is supported. All
the atomic counters identify an offset within this buffer. The shader
is modified to include a storage buffer definition with
`uint counters[];` as the only field.
A compiler pass replaces atomic counter definitions with variables that
hold the corresponding offset parameter, as well as changing atomic_uint
types to just uint (as the offset). Where an atomic counter variable is
used, it is replaced with the offset variable (plus the array index, if
array). At the same time, built-in `atomicCounter*` functions are
replaced with a corresponding `atomic*` function and
`memoryBarrierAtomicCounter` is replaced with `memoryBarrierBuffer`.
Bug: angleproject:3566
Change-Id: Iefb3d47de6a5cb3072bfa0cb94a46ac6a886d369
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1704635
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
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>
Reason for revert: default uniform initialization was incomplete
This change has the following fixes:
1. Add missing default uniform initialization when loading
program binaries.
2. Re-enable OES Program Binary capabilities for Vulkan.
3. Added two angle end2end test,
- ProgramBinaryES3Test.BinaryWithLargeUniformCount
uses several uniforms across the vertex and fragment
shaders.
- ProgramBinaryES3Test.ActiveUniformShader tests
the difference between uniform static and active use
Bug: angleproject:3216
Bug: angleproject:3217
Bug: angleproject:3665
Tests: dEQP-GLES3.functional.shader_api.program_binary*
angle_end2end_tests --gtest_filter=ProgramBinary*
Change-Id: If6886f01241d65bb1e17a21cc3406533021072ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1699069
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
ID3DUserDefinedAnnotation is not thread-safe, like ID3D11DeviceContext,
however, it's being accessed from WorkerThread for parallel compilation,
thus guard it with mutex lock.
Bug: angleproject:3493
Change-Id: Ic7cc7fe03675174e054fe1e11d8d9e05abc716a5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709726
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
1. python script wrapper to call clang-format over the whole code base
2. Add clang-format rule `IncludeBlocks: Preserve` to tell clang-format
do not merge include blocks
3. Fix existed clang-format issue in code base
Bug: angleproject:3532
Change-Id: I289292dc62c2784ff21688065c87c3f3f5538f17
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709720
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Fixes handling of packed vertex formats, adds new overrides for 32-bit
[SU](NORM|SCALED) vertex types, and handles half-precision floats
correctly.
Pixel 2 does not natively support certain 10-10-10-2 vertex formats;
this change does not add support for them.
Test: ./angle_deqp_gles3_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES3.functional.vertex_arrays.*'
Test: ./angle_end2end_tests --gtest_filter='AttributeLayout*/ES3_Vulkan'
Test: ./angle_end2end_tests --gtest_filter='VertexAttribute*/ES3_Vulkan'
Bug: angleproject:3193
Change-Id: I5ae4edd743e86e3e89e2697034c04dc4d9ecd1f9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1668230
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: James Dong <dongja@google.com>
The context used for Image creation was being used during orphaning. This
causes problems when the image is created with an external source or when
different contexts are used between creation and orphaning.
BUG=angleproject:3722
Change-Id: Iee4abd2116c3410efd8fb35722cc956cc6d8a3fa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709753
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
egl::Image destroys the source sibling before calling the backend destroy
function. ImageVk needs the source image to do proper clean up.
BUG=angleproject:3722
Change-Id: I110d77a9c4151166624bb953c579102ac7dab6ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709752
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
This allows us to pass some dEQP GLES 2.0 tests that require using an ES 3.0
context and matches native driver behaviour of returning a higher-than-
requested context version when it's backwards compatible.
BUG=angleproject:3425
BUG=angleproject:3300
BUG=angleproject:3715
BUG=angleproject:3243
BUG=angleproject:3240
BUG=angleproject:3716
Change-Id: I03dfd56deb6191c3363808717e0eea6fdcf5f3ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709111
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Make sure to set a uniform's flattenedOffsetInParentArrays
value only if it has a valid parent array index.
Serialize/Deserialize flattenedOffsetInParentArrays value.
Bug: angleproject:3216
Bug: angleproject:3217
Bug: angleproject:3665
Change-Id: I6e4d003b1dd74b330bcf153f8d3df92414f198dd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1704219
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
The current implementation generates entry points for GL up to
version 3.1. Will need to support later versions for some apps.
Bug: angleproject:3698
Change-Id: Ic44d07b12a9eeeceb8cd98dd9c44652dca728dc0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1700572
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Need to rename these so that they don't conflict
with GL function declarations
Bug: angleproject:3702
Change-Id: Iefe490cb53a384c45f0d0024321deda43b461bcc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1704214
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Clemen Deng <clemendeng@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>
1. Add a fast matrix update function to do a single memcpy for uniform
matrix assignment with same layout. It benefits row-4 no-transpose GLSL
matrix and col-4 transpose HLSL matrix.
2. Make boolean IsColumnMajor to be a template parameter in generate
uniform matrix updating, which gets rid of the conditional branch
in loop and has better performance.
3. Add e2e test of uploading multiple 3x4 GLSL matrices at the same
time, which adds coverage to this CL.
Bug: angleproject:3632
Change-Id: Id1701ef6fbf63ea4b9884254d93ea8eacfe4e16a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688274
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This reduces the test time to run in several ms instead of almost
seconds per iteration. It allows us to use the perf test runner harness
to check test performance more accurately by increasing the sample
count.
It first reduces the test iteration count to reduce total test time.
It also refactors the test contents to not allocate new objects and
memory with every test iteration. This gives a better sampling of what
the test is obsering: texture upload performance.
Also allows tests that like to track GPU time to be used with the NULL
device option.
Bug: angleproject:3712
Change-Id: Idacc3e3b424f8882d7680769b27d1f04146ea65d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707112
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>