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>
This reverts a behavioral regression introduced in commit c3542b135e,
which deferred callback submission until the program was first used.
This commit restores the correct behavior by submitting the callback
handle as soon as the token's work is complete. This occurs either upon
successful `gl.program` population or via cancellation, ensuring the
caller is properly notified that the resource loading operation has
concluded.
This class will allow better tracking of memory
allocations and recycling of buffers. Currently
only the uniform buffers are recycled.
It will eventually allow us to dynamically change
the underlying GPU buffer of a VulkanBuffer when
updating an UBO for uniforms and also keep track
which of those buffers are still inflight and which
ones are ready to be reuse for an UBO.
Its the first step on moving towards by passing
the staging buffer in UMA.