gfxstream: move isHostVisible function

It's separable from the rest of CoherentMemory class.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32015>
This commit is contained in:
Gurchetan Singh 2024-11-01 15:04:13 -07:00
parent 5d299a0bd4
commit 6a9eb986c2
3 changed files with 4 additions and 6 deletions

View file

@ -16,10 +16,6 @@ using android::base::SubAllocator;
namespace gfxstream {
namespace vk {
bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index) {
return memoryProps->memoryTypes[index].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
}
CoherentMemory::CoherentMemory(VirtGpuResourceMappingPtr blobMapping, uint64_t size,
VkDevice device, VkDeviceMemory memory)
: mSize(size), mBlobMapping(blobMapping), mDevice(device), mMemory(memory) {

View file

@ -24,8 +24,6 @@ constexpr uint64_t kHostVisibleHeapSize = 512 * kMegaByte; // 512 mb
namespace gfxstream {
namespace vk {
bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index);
using GoldfishAddressSpaceBlockPtr = std::shared_ptr<GoldfishAddressSpaceBlock>;
using SubAllocatorPtr = std::unique_ptr<android::base::SubAllocator>;

View file

@ -268,6 +268,10 @@ bool descriptorBindingIsImmutableSampler(VkDescriptorSet dstSet, uint32_t dstBin
return as_goldfish_VkDescriptorSet(dstSet)->reified->bindingIsImmutableSampler[dstBinding];
}
static bool isHostVisible(const VkPhysicalDeviceMemoryProperties* memoryProps, uint32_t index) {
return memoryProps->memoryTypes[index].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
}
VkDescriptorImageInfo ResourceTracker::filterNonexistentSampler(
const VkDescriptorImageInfo& inputInfo) {
VkSampler sampler = inputInfo.sampler;