This change switches the internal enums we pass around from VkFormat
to FormatID. The end goal of the refactor is to allow the Vulkan
back-end to store packed tables indexed by FormatID. Because VkFormat
has large gaps in its enum space we'd otherwise need to use unordered
data structures like unordered_map.
The change removes the redundant VkFormat storage from vk::Format and
uses a new table query to return the VkFormat that 1:1 matches an
angle::FormatID. We also include a reverse mapping for use with native
Vulkan get functions for Android.
Also moves sRGB conversion functions into renderer_utils. A couple
sRGB formats that don't exist in GL are no longer handled by the sRGB
conversion functions. These formats should be extremely rare.
Bug: angleproject:5438
Change-Id: Id8b49773ca0c556f9f5a6a10fcf0d9762b93bbea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618204
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
libstdc++ does not allow incomplete type for T2 with std::pair<T1,T2>
and fails with:
.../../src/libANGLE/renderer/vulkan/vk_cache_utils.h:1570:64:
required from here
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/include/g++-v9/bits/stl_pair.h:215:11:
error: std::pair<_T1, _T2>::second has incomplete type
215 | _T2 second; /// @c second is a copy of
the second object
| ^~~~~~
https://chromium-review.googlesource.com/c/angle/angle/+/2580111
added class FramebufferCache with incomplete type in |mPayload| to
vk::FramebufferHelper. Changing include order is not an option.
However, FramebufferCache is only used in FramebufferVk and we
can make it local there.
Bug: chromium:957519
Change-Id: I5fbdca23adbb9f4aecc266988c02fb0d051504cb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2621473
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This is a reland of 03f3ba5b14
Original change's description:
> Created test and fixed texture storage bug in d3d11
>
> Bug: b/172489285
> Change-Id: If7d88cf50d99da3380082c60fb3936ae0b20c4e5
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2519876
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Bug: b/172489285
Change-Id: I6b8226164a09aed208c56cb78b5d2c1385298cbe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2546034
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Trevor David Black <vantablack@google.com>
Commit-Queue: Trevor David Black <vantablack@google.com>
This improves perf because vertex data upload uses host visible memory,
and uncached memory can be slow.
Test:
Android on Windows with 1080Ti:
glmark2 [build] vbo=false 265 -> 3900 fps
Bug: angleproject:5515
Change-Id: Ib75582bbdb4ca4a22d3a121c7b477a23a8a809ef
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2615742
Commit-Queue: Lingfeng Yang <lfy@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
The FloatToHalf() function in "es31cVertexAttribBindingTests.cpp" will
attempt to right-shift more than the number of bits in an integer
(i.e. by 70) when converting 0.0f to GLhalf.
Bug: angleproject:5500
Change-Id: I587e71a2cb1377b95ed74a1bba5f4ceef6a4a516
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618665
Commit-Queue: Ian Elliott <ianelliott@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
A test is added that dispatches a large number of vertex shaders,
generating primitives that are all culled. The vertex shaders are
simple so that code injected for pre-rotation would make up the majority
of the shader code.
Bug: angleproject:5478
Change-Id: I75092cb25e6427449251985f56e54f89813dec32
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2615821
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Since some ASTs are now disabled on certain conditions, this change lets
the fuzzer know when it has generated invalid translator options.
Bug: chromium:1164448
Change-Id: I1f1b120c33fb70f9776df858db033ec914d7ad89
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618203
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This is a reland of 11c31e0a4a
I've landed upstream Skia change https://skia-review.googlesource.com/c/skia/+/351496
which should make this safe to reland.
Original change's description:
> Changes to build inside a Dawn checkout.
>
> Add an "angle_standalone" flag that can be disabled by Dawn.
> Put test definitions behind angle_standalone || build_with_chromium.
>
> Bug: angleproject:5462
> Change-Id: I58c9b18723384334156e2a3dd86ed3f89afcaade
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2587451
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Stephen White <senorblanco@chromium.org>
Bug: angleproject:5462
Change-Id: I4ff92d45b3692312a004f03b425234b78c5a6219
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618040
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
We weren't subtracting reserved varying vectors from component limits.
We also were using an incorrect value for fragment input components.
Bug: angleproject:5496
Change-Id: I44fc3b2f15687f4dee7a1498d50378e69d74afe3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606536
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Was a needed fix for a new varying test.
Bug: angleproject:3571
Bug: angleproject:5496
Change-Id: I49ae69967510b7a6330ea217a0e0e19e3bebe865
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613198
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
This merges two very similar pieces of code into one simpler function.
The function doesn't use any maps or indirection to build the merged
varyings list. It also fixes a potential bug with IO blocks and name
matching due to the code bifurcation.
Bug: angleproject:5496
Change-Id: Ibf54faeeb01d1940570b366ed153fff7c9135c52
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606533
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
If an update to an image subresource is entirely superseded by a
following update, the former update is dropped. This change adds a perf
warning for this.
Bug: angleproject:3461
Change-Id: Iaf4984ba52f3dfc86d5cc87f8be82123badebd04
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613203
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
ANGLE's GLX backend creates a child ID because the visual of the X
window must match that of the GLX window, and we can't always be
certain.
EGL_ANGLE_x11_visual allows applications to specify the visual ID
of the window passed to ANGLE via EGL_X11_VISUAL_ID_ANGLE. When this
is the case, we don't need to make a child window.
Since Chrome always passes this information, this may help optimize
ANGLE's GLX usage in Chrome, because we don't have to poll the parent
window to manage the child window's properties.
Bug: chromium:1132827
Change-Id: If8082d2d07469905afffab01dde2ec9fca8d4eb9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2611556
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
"World War Doh" binds uniform buffers via glBindBufferBase() calls
before any frames have rendered and then uses those bound buffers for
all subsequent frames. ANGLE's frame capture was failing to perform
these calls during the mid-execution capture setup phase, leading to
the replay generating VVL errors:
VUID-vkCmdDispatch-None-02699
Descriptor in binding #0 index 0 is being used in draw but has never
been updated via vkUpdateDescriptorSets() or a similar call.
This CL adds those calls to the MEC setup phase, allowing the replay to
execute without any errors.
Bug: angleproject:5495
Test: angle_perftests --gtest_filter="*world_war_doh*"
Change-Id: I751c9c6f60bf78c13428a9d1d6a06dbfe600c24b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606806
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Tim Van Patten <timvp@google.com>
When removing superseding updates, the superseded update was not
released, causing a memory leak. This change also makes
SubresourceUpdate non-copyable and correctly implements the move
assignment operator such that swap between different update types are
correct. As a result, the destructor can now ASSERT that the image is
not leaked.
Bug: chromium:1146516
Bug: chromium:1163354
Change-Id: I7531c91d8559c23b2e09159118fe645d12fc601f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613201
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Most of these tests use TranslatorGLSL or TranslatorESSL (often through
ShaderCompileTreeTest). In specialized builds that disable GLSL and
ESSL shader generation, disable these unit tests.
Bug: chromium:1161513
Change-Id: Ib87e651706f141a41ffdaebfb0cbe5168582e341
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613202
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
A new function is added by the translator to calculate the transform
feedback offsets in the emulation path. This function makes the
generated code for transform feedback smaller.
Bug: angleproject:3606
Change-Id: I01460f907e20e2887cb720bddad96697fdcb0cf3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2607492
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
When a command buffer is ended, bindings are lost. This adds a dirty
bit to `mNewGraphicsCommandBufferDirtyBits` to make sure transform
feedback buffers are bound again on the new command buffer.
Bug: angleproject:5428
Change-Id: I7733c93b1eb5d33a77cbee231a83199be950e19f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2611552
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This AST transformation is used by the chromium validating command
decoder on Linux/AMD/GL as well as MacOS.
Bug: chromium:1161513
Change-Id: I67e40215ae5576819ba5a58987ceb1776c86c731
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613195
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
The index expression was regenerated for every component written to the
output. This change refactors the generated code such that common
values are calculated once.
This is in preparation for moving some of this code to the translator
and reducing the amount of code generated at link time.
Bug: angleproject:3606
Change-Id: Ib180d245218f8f6f18c57c0ea092e8c45cbffd1a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2607490
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
on Vulkan Pixel2 and SwiftShader.
Ignore device and vendor in test config
if we are running on SwiftShader.
Bug: angleproject:5500
Change-Id: Ib07240dfe1c2ae1d6d081ffa389d041d97b22b36
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2611309
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
https://chromium.googlesource.com/vulkan-deps/+log/b08eace32e9c..cbab637962d0
$ git log b08eace32..cbab63796 --date=short --no-merges --format='%ad %ae %s'
2021-01-06 chromium-autoroll Roll SPIRV-Tools from d630e5f8c10c to 37c03859de9e (1 revision)
2021-01-06 chromium-autoroll Roll Vulkan-ValidationLayers from 2468aa9630c2 to 98382948dfea (1 revision)
2021-01-06 chromium-autoroll Roll SPIRV-Tools from 1bb80d2778a3 to d630e5f8c10c (1 revision)
2021-01-06 chromium-autoroll Roll glslang from 9325cc013e3d to f77085c307fc (1 revision)
2021-01-05 chromium-autoroll Roll Vulkan-ValidationLayers from 57255a663ed9 to 2468aa9630c2 (1 revision)
2021-01-05 chromium-autoroll Roll Vulkan-Loader from 1f0c7868a438 to 9ba835885ffe (1 revision)
2021-01-05 chromium-autoroll Roll Vulkan-ValidationLayers from 56a96658b750 to 57255a663ed9 (3 revisions)
2021-01-05 chromium-autoroll Roll Vulkan-Loader from 294480cb7f3e to 1f0c7868a438 (1 revision)
2021-01-05 chromium-autoroll Roll Vulkan-Tools from 7554321b88ae to 4cc0932495ec (2 revisions)
2021-01-05 chromium-autoroll Roll Vulkan-Loader from 66a23ac8c566 to 294480cb7f3e (1 revision)
2021-01-05 chromium-autoroll Roll Vulkan-Headers from 85470b32ad5d to 9efc4a631161 (1 revision)
2021-01-05 chromium-autoroll Roll Vulkan-ValidationLayers from aa076dae88e2 to 56a96658b750 (25 revisions)
2021-01-05 chromium-autoroll Roll glslang from f426f652299d to 9325cc013e3d (1 revision)
2021-01-05 chromium-autoroll Roll SPIRV-Cross from e50f7d1ce8e1 to 7b7a21c4058c (3 revisions)
2021-01-05 chromium-autoroll Roll SPIRV-Tools from 17ffa89097b2 to 1bb80d2778a3 (1 revision)
2020-12-21 jmadill Rolling 8 dependencies
Created with:
roll-dep third_party/vulkan-deps
Bug: angleproject:5390
Change-Id: I6f4a499099211e8990ed038984f41bc5f881c71f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2601340
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Instead we can pass the pack mode and size to the collectAndPack
method. This cleans up the interface and also allows us to merge
two separate code blocks in Program and ProgramPipeline.
Bug: angleproject:5496
Change-Id: I390b5d2e8a3b033374ccc5a250597be1f03dec96
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606531
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
This clarifies the difference between "collect" and "pack" methods.
Previously the naming was overlapping between the two. Also makes
the "packUserVaryings" method private.
Refactoring change only. Will enable further improvements for
capturing varyings with multiple shader stages.
Bug: angleproject:5496
Change-Id: I854590ceab39f3a0e7a785516e0d1fd44e4ccc98
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606529
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>