* Normally a mesh rendering replay output would do this implicitly when
an event is selected, but if accessing purely through script this may
not happen, so we should initialise it ourselves here.
* If it's already init'd, it's almost free to call again.
* The previous fix was insufficient, the iterator being at end() is only
one way push_back can invalidate it, the other is if the array being
expanded is large enough (or things are just right) that the vector
resizes.
"cmd package resolve-activity" is only available from Android 7.0. Pre Android 7.0 we can use "pm dump <packagename>" to get the default Activity name.
* Since we search for #version, if it appears in a separate source
string from the rest of the shader, we fail to find the right place to
insert the patch blocks. If we concatenate first, it makes it easier.
Adhere to vkImageMemoryBarrier valid usage:
If image has a depth/stencil format with both depth and stencil
components, then aspectMask member of subresourceRange must include both
VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT
* On GL shader reflection is mutable but only between different events
(we can expect it to be consistent/cacheable for a single event).
* We don't want to delete shader reflection pointers out from under the
UI, and it's not feasible to invalidate all pointers it might hold at
any point - e.g. previous to this change when a ReplayLog happens.
* Instead we just add another dimension to the cache key and allow the
cache to bloat more on GL, preserving possibly redundant reflection
objects.
* We were already fetching and compacting vertex buffers so this wasn't
as big a change as expected - it just needs to expand out e.g.
R16G16B16A16_SNORM to R32G32B32A32_SFLOAT so that it can be created
as a texel buffer (where the former may only be supported via fixed
function vertex inputs).
* This isn't 100% reliable but it seems reasonably consistent that while
the first file in the streams isn't always the entry file, the first
name of a file in the list of names which map to files is. So we
re-sort by the list of names.
* This can happen in cases where the application syncs to the GPU after
using one set of descriptors from a pool, resets it, and then
allocates more descriptors out of the pool to use later in the frame.
* Since we allocate all descriptors up-front before the frame starts we
end up allocating more than the high-water mark, and running out of
room in the pool.
* Instead we just allocate duplicates of the pool as needed, as overflow
space, and then use those overflow pools to satisfy any extra need.
* Since we aren't displaying multiple instances we don't want to change
the instance selection, so instead of returning 0 return the currently
selected instance.
* Unfortunately some formats are *only* supported through VB fixed-func
inputs, and not through any other access (like texel buffer access).
* As a result, it's invalid for us to just create buffer views using
these formats to read from, so we will need to read-back the data to
the CPU, decode and unpack to another format that is supported, and
then re-upload. In some cases this might be extremely complex (e.g.
64-bit wide formats that have no easily supported fallback).
* In the meantime, we just re-write the format to R8G8B8A8_UNORM. It
will return the wrong data, but will at least not crash.
* Some memory types may not be compatible with buffers, so allocations
in those memory type indices we just don't create a spanning buffer,
as it won't be needed anyway to restore memory contents.