Add missing functionality that can recreate shaders and programs
that are deleted during the run.
Test: Plants vs. Zombies Heroes MEC
Bug: angleproject:5968
Bug: angleproject:7848
Change-Id: I2d41ebe9df1e2ad1beef831acd72fd3f06f4eb1f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4060241
Commit-Queue: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
QueueSerial right now checks if serial is valid or not in various
comparison. This CL removes valid() method from class Serial and rely on
the fact that default constructor always constructs kZeroSerial and
kZeroSerial is always smaller than any serial, i.e, always appears as
flushed, submitted and completed. This removes one branch from critical
code path where we try to detect if a buffer/image is used by a
renderpass or not etc.
Bug: b/262047600
Change-Id: Ic76fe1409d9911dc7eb86107c9a930d8bb5eaa05
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089848
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Building on work by Tim Van Patten <timvp@google.com>
In https://chromium-review.googlesource.com/c/angle/angle/+/3388635, not
only were unmasked scissored clears made to use vkCmdClearAttachments,
but also scissored clears could use loadOp=Clear. While this is
potentially faster, it comes with a number of complications.
This change only does the former. Unfortunately, due to a Qualcomm
driver bug that forces ANGLE to avoid vkCmdClearAttachments, code
simplification in the draw path cannot be made.
Bug: angleproject:5194
Change-Id: Iec4184a09ca7fd09e3e8148c53db503512e6b8f0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3935893
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Bug: b/262585507
Change-Id: I7e081c5a1dacbcf1221d7580f33ce504442ebbbc
Signed-off-by: Zhang Ye <haocheng.zy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4104471
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
This class was just forwarding functions, and had over time become too
thin.
Bug: angleproject:7220
Change-Id: I7ae84ba017478d5c36b1e6d5f98a52d6b1cffb66
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103744
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
No longer used by metal/.
Bug: angleproject:7220
Change-Id: Idb3a6369fefbcf87e7993daa652c8702ec53c20f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4104002
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Yuxin Hu <yuxinhu@google.com>
With this change, once a pipeline is created out of libraries, a task is
scheduled (if necessary) to asynchronously create a corresponding
monolithic pipeline. Once the task is complete, the linked pipeline
handle is replaced by the monolithic one, gaining back any performance
that might have been lost due to the use of libraries.
Bug: angleproject:7369
Change-Id: I525fb1e09f8bedc61b9dbef19f9cce7026ff9c53
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4031151
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
This reverts commit 4e54e434bd.
Reason for revert: Causes ANGLE to crash on Android when loading from an APK
Original change's description:
> Workaround GetModulePath() returns incorrect path for exe in Chrome
>
> Chrome changes process title that causes dladdr returns wrong module
> path for executable binary. Workaround the problem by using
> GetExecutablePath() which gets path from /proc/self/exe.
>
> Bug: chromium:1399828
> Change-Id: I7dd89387160103af51e267a1dc8464715311f771
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089450
> Auto-Submit: Peng Huang <penghuang@chromium.org>
> Commit-Queue: Peng Huang <penghuang@chromium.org>
> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Test: Load ANGLE from APK on Android
Bug: angleproject:7888
Change-Id: I27f3e8fa7e5bbb0911669ece6afce61f4e9a2713
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4105340
Auto-Submit: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
The only difference between ResourceSerial and UniqueueSerial (formerly
Serial) appears to be ResourceSerial is wrapper of object pointer. This
CL removes ResourceSerial class and switched it to UniqueSerial class
instead. (We may need to see why it needs to use pointer to initialize
the serial, that sounds like the exact thing serial try to avoid.)
Bug: b/262047600
Change-Id: Ic8e1b26d7da9304ff02fd9a7e1b584bb70efcb77
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4102107
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
This CL splits Serial class into two classes: UniqueSerial and Serial.
UniqueSerial supports the object unique serial usage where there is ==
and != operator but no > or < comparison. UniqueSerial can have invalid
value, but Serial will not have invalid value (in next CL). The main
reason is for next CL we can further optimize out the invalid value
check in the QueueSerial comparison.
Bug: b/262047600
Change-Id: Ieaed2a0d5546b012a6d63aa18b6006595e4aee1b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4093557
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Vertex input and fragment output partial pipelines are kept alive until
context destruction, so there's no need to retain them.
Bug: angleproject:7369
Change-Id: I8cbe5b9f70845bb5d9348f11889f64a6a94a6b87
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4100407
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Fix build breakage for GCC because of calling non constexpr function
from a constexpr function.
The error example:
third_party/angle/src/libANGLE/renderer/serial_utils.h:214:40:
error: call to non-'constexpr' function 'rx::Serial
rx::AtomicQueueSerialFixedArray::operator[](rx::SerialIndex) const'
Bug: chromium:819294
Change-Id: Ic09be54ce9418ab3f7d947eaa27c97b55c3c2bab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4098527
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Resource::retainCommands() API name no longer make sense. This CL
removes retainCommands and retainReadOnly and retainReadWrite APIs and
replaced with setQueueSerial and setWriteQueueSerial call directly.
This CL also merges some of single inline functions to minimize the
file, sine the class is small anyway.
Bug: b/262048658
Change-Id: I9d16b82c79b27f3285311393601705a4ee7f6d8a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4098005
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
As required by the spec, it's not enough to keep the linked pipeline
alive. With this change, the serials of the invidual libraries are
updated every time the serial of a linked pipeline is updated.
Bug: angleproject:7369
Change-Id: Iedc98a427d988d00b4e8745964d9827fdf51ea7f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4098744
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This is used only from DynamicallyGrowingPool<Pool>::onEntryFreed to set
the its tracking QueueSerial. There is better way to do this now with
per context serial. We can simply merge the QueryHelper's mUse into the
pool instead of setting pool's use to the current queueSerial. The
benefit of doing that is to possibly allow pool gets reuse/freed earlier
(i.e., more accurate tracking). This CL switches it to more accurate
tracking and removes mCurrentSerial from Context.
This CL also removes unused DynamicSemaphorePool class.
Bug: b/262054987
Change-Id: Iac3e2495cc0e3623ba63e9da7f32ad6e9c223467
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089847
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
* Added angle_trace_tests as an acceptable input for
run_angle_android_test.py after the change to split
trace tests from perf tests.
Bug: angleproject:7755
Change-Id: Ia95d20c1ba8479c14055aa1515c1c4b6dc264a86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4068354
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
* Added RingBufferAllocator.cpp with implementation.
* Main classes:
* RingBufferAllocator (fast allocation with bulk deallocation)
* SharedRingBufferAllocator (wrapper to help with shared use and
multiple threads)
* Implemented "angle_enable_vulkan_shared_ring_buffer_cmd_alloc"
feature. (Disabled by default)
* Details (from the original CL)
* The angle::PoolAllocator replaced with
angle::RingBufferAllocator.
* Before, there was separate angle::PoolAllocator per each
CommandBufferHelper. Now, a single angle::RingBufferAllocator
is shared between multiple CommandBufferHelper objects.
* Commands data from multiple CommandBufferHelpers is
tightly packed without fragmentation.
* Significantly less memory overhead, observed with enabled
async queue.
* Moved the parts of the code related to the allocators into the
classes in the new AllocatorHelperPool and AllocatorHelperRing files
for better management. The allocator can be switched by changing the
following BUILD flag:
`angle_enable_vulkan_shared_ring_buffer_cmd_alloc`
* It is connected to the following macro:
ANGLE_ENABLE_VULKAN_SHARED_RING_BUFFER_CMD_ALLOC
* The two main allocator classes in each file are aliased as:
* SecondaryCommandBlockAllocator (in CommandBufferHelper objects)
* SecondaryCommandBlockPool (in SecondaryCommandBuffer)
* Also added placeholder functions for VulkanSecondaryCommandBuffer.
* Added descriptions regarding the two allocators.
* renderer/vulkan/doc/Allocators.md
Credit: Original CL authored by Igor Nazarov <i.nazarov@samsung.com>
Bug: angleproject:6401
Bug: b/256666069
Change-Id: I0f24793eef6334bf4ff8e327b9665338807dad37
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3715968
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
These were flaky, let's see if recent X11 related changes fixed this.
Bug: angleproject:5753
Change-Id: I9f112f8d01cb838bc588b818a0a7d0a4ec5fd087
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4097404
Auto-Submit: Roman Lavrov <romanl@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
To simplify the code slightly. The main reason for this is that the two
class variables of ReadWriteResource totally does not make sense:
mReadOnlyUse actually manes any usage, read or write. mReadWriteUse
actually means write usage.
Since Resource class's mUse means any access, subclass ReadWriteResource
from Resource class makes more sense since mUse means exact same thing
in both classes.
This CL also changes ReadQriteResource::mReadWriteUse to mWriteUse.
Bug: b/262048658
Change-Id: I0e3172a70b8cb6a6481045c46690b69fbfe9523c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089983
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Right now for oneoff submission we are creating a fence and pass in the
fence and then wait for fence outside the normal wait code path. This
creates a problem that the command buffer and garbage clean up code does
not gets run and may end up hitting assertion. This might be necessary
before because complication with ResourceList. With recent work that
removes ResourceList, this can be much simpler now. This CL removes the
fence creation and wait in the oneoff submission code path (except the
external fence) and switch to finishQueueSerial call.
Bug: b/255414841
Change-Id: I2b16c187becbda9c2397685c7212abac994e8dc2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4053261
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
Due to header file include order, this function can not directly
made inline. This CL removes the function and replace it with
renderer->getUnfinishedUse() to reduce one extra function call of one
line function.
Bug: b/262048658
Change-Id: Ied33b63d0ec88336a5ce42cf7726f16b2b883b86
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089623
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
BufferVk::mapRangeImpl() want to ensure any GPU write command has been
flushed and finished. Right now it calls flushImpl if there is any
unflushed access. It should only need to flush if there is any unflushed
*write* command. This CL changes check of any access to any write
access.
This CL also inlines isCurrentlyInUseForWrite/finishGPUWriteCommands and
removed these two single line function calls.
Bug: b/261772793
Change-Id: I1628ec31eaceb87f82e654cb1f317570ff2f6c12
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4086972
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Right now there are two different type of garbages. Objects like buffer
or VkImage that can be used by different contexts and are GPU tracked as
they are been used. These objects goes to RendererVk::mSharedGarbage.
The one time use objects or objects are not been tracked as they are
been accessed, they add to the context's garbage list and their mUse
gets updated when commands gets submitted. With new per active context
queue serial, the update of mUse can be immediate and low cost ( write
to an entry in the array), so there really isn't a good need to keep
two garbage list. This CL only deals with PipelineHelper object that
makes it goes through general collectGarbage code path instead of
ContextVk::mCurrentGarabge, since the PipelineHelper object is already
mUse tracked properly.
Bug: angleproject:7862
Change-Id: Ie77229683828590546f06938add057cf5610835b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089984
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
This ensures that if one context batches updates to a descriptor set,
that other contexts in other threads are able to flush them if
necessary. This is necessary as descriptor sets are themselves shared
between contexts.
Bug: b/261552549
Bug: angleproject:7881
Change-Id: Id1a895b05fe31d118e8fb3fa64e5ccd67cff7923
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4088904
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
ANGLE records commands (a queue transfer and layout transition) when an
external image is bound to a texture or a renderbuffer. If another
thread starts using these resources, the recorded commands should have
been flushed. The application is not required to synchronize between
the threads in this case (or at least, there are applications that
don't).
Bug: b/261552549
Change-Id: I9f345316269baf5f10576dbef73b86924efd5c6f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4088903
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Charlie Lao <cclao@google.com>
* Fixed gl_PerVertex qualifier string.
* Updated ValidateClipCullDistanceTraverser to output
redeclared array sizes and maximum constant indices.
* Made DeclarePerVertexBlocks available for non-Vulkan
outputs.
* Updated DeclarePerVertexBlocks to remove gl_ClipDistance
and gl_CullDistance redeclarations.
* Enabled DeclarePerVertexBlocks for ESSL output when
gl_ClipDistance or gl_CullDistance are redeclared.
* Updated ESSL output to use 3.10 shading language version,
when the context has GL_EXT_clip_cull_distance enabled.
* Updated ESSL output to enable GL_EXT_shader_io_blocks
when gl_ClipDistance or gl_CullDistance are redeclared.
* Updated extension exposure conditions.
* Fixed typos in ParseContext.
Bug: angleproject:7763
Change-Id: Ib87368a1953ad546a407d634d8b00f71cf92c40c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4083705
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This mutex lock is no longer used and needed, thus removed in this CL.
Also removed unused BufferAccess enum class.
Bug: b/261737134
Change-Id: I7391e84c5b2abcd87de6ce9e66ba85f81ff7dce3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4086934
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This was introduced in crrev.com/c/3449450. At that time this is
necessary, because we can not copy mUse for immediate view garbage
collection. Now with recent work, mUse is copyable, we no longer need to
accumulate the view garbage. They can be released immediately with a
copy of image's mUse.
Bug: b/261737134
Change-Id: Ic4393f8c4ee7c0e3be4669a0a557507c909a77ab
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4087323
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Charlie Lao <cclao@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Chrome changes process title that causes dladdr returns wrong module
path for executable binary. Workaround the problem by using
GetExecutablePath() which gets path from /proc/self/exe.
Bug: chromium:1399828
Change-Id: I7dd89387160103af51e267a1dc8464715311f771
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4089450
Auto-Submit: Peng Huang <penghuang@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>