When a program was created directly from a cached blob in
`ShaderCompilerService`, its associated token was not signaled as ready
in the THREAD_POOL mode. This oversight caused a deadlock at the
`token->wait()` call during program destruction.
This commit resolves the issue by skipping the token's readiness check
upon destruction if the program was created from the cache blob.
BUGS=[423221474]
Some edge case handling features are possibly needed, but should only be made
once they have use cases that exercise that behavior. So for now just
leave TODOs explaining where to add it in the future.
BUGS=[422804941,422803382]
Use more accurate parameter names. 'types' indicate the types
of memory we are considering. 'reqs' indicate the requirements
each type must meet.
BUGS=401579988
The vulkan backend is currently single threads, so there's
no need for VMA to use synchronization internally. This
will improve the CPU performance when going through VMA.
Co-authored-by: Serge Metral <sergemetral@google.com>
* materials: introduce mutable spec constants
Rationale & design of this feature has been discussed internally.
The current implementation uses a `FixedCapacityVector` to store the new program
handles, but I wouldn't object to replacing it with a hasmap as discussed
offline.
I have compiled but not tested this yet on Android, so I'm not certain that the
API bindings are correctly wired up.
* materials: mutable spec constant feedback
* materials: address mutable spec constant comments
On starting gltf_viewer on mac, there were validation errors on
1) copying to a depth texture using the aspect COLOR.
2) querying formats that required extensions without enabling those
extensions.
* Switch to block-based stage-pool for Vulkan
Instead of allocating a staging buffer every time one is needed,
allocate a large (8mb) block of memory, and divvy it up as needed.
We will make this configurable in the future, to allow for tuning
for different apps as needed.
* Address PR comments: use fvkmemory::Resource
Instead of having the child block be a unique_ptr that we create a
separate container for within the command buffers, just have the
stage block segments be fvkmemory::Resource instances.
* Address PR comments for staging buff change
- As per discussion with @poweifeng, change the name of a variable
called "stage" to "stageSegment" for clarity
- As per discussion with @rafadevai, change the order of terminate
calls in VulkanDriver to better reflect cleanup order of some
objects.
* Align stage pool to nonCoherentAtomSize
In order to prevent flushing more atoms than were modified when writing
data to host-mapped memory in a staging buffer, ensure that all segments
allocated are aligned to nonCoherentAtomSize.
Also - fix merge conflict compile errors.
---------
Co-authored-by: Serge Metral <sergemetral@google.com>