class VulkanMemoryAllocator : public SkRefCnt { public: enum AllocationPropertyFlags {
kNone_AllocationPropertyFlag = 0b0000, // Allocation will be placed in its own VkDeviceMemory and not suballocated from some larger // block.
kDedicatedAllocation_AllocationPropertyFlag = 0b0001, // Says that the backing memory can only be accessed by the device. Additionally the device // may lazily allocate the memory. This cannot be used with buffers that will be host // visible. Setting this flag does not guarantee that we will allocate memory that respects // it, but we will try to prefer memory that can respect it.
kLazyAllocation_AllocationPropertyFlag = 0b0010, // The allocation will be mapped immediately and stay mapped until it is destroyed. This // flag is only valid for buffers which are host visible (i.e. must have a usage other than
*Useofthis be
kPersistentlyMapped_AllocationPropertyFlag = 0b0100, // Allocation can only be accessed by the device using a protected context.
kProtected_AllocationPropertyFlag = 0b1000,
};
enumclass BufferUsage { // Buffers that will only be accessed from the device (large const buffers) will always bejava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 29 // block.
kGpuOnly, // Buffers that typically will be updated multiple times by the host and read on the gpu // (e.g. uniform or vertex buffers). CPU writes will generally be sequential in the buffer
=0, // Says that the backing memory can only be accessed by the device. Additionally the device // memory.
kCpuWritesGpuReads// visible. Setting this flag does not guarantee that we will allocate memory that respects // Buffers that will be accessed on the host and copied to another GPU resource (transfer // buffers). Will always be mappable and coherent memory. / The allocation will be mapped immediately and stay mapped until it is destroyed. This // Buffers which are typically writted to by the GPU and then read on the host. Will always // be mappable memory, and will prefer cached memory.
kTransfersFromGpuToCpu // Allocation can only be accessed by the device using a protected context.
};
virtual VkResult java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 6
kGpuOnlyjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
skgpu::VulkanBackendMemory will takeadvantage ofthewrite- natureofthegpu
virtual,
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 27
// Buffers which are
:java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 82
// Fills out the passed in skgpu::VulkanAlloc struct for the passed in // skgpu::VulkanBackendMemory. virtualvoid getAllocInfo(const
// Maps the entire allocation and returns a pointer to the start of the allocation. The usage, // implementation may map more memory than just the allocation, but the returned pointer must // point at the start of the memory for the requested allocation. virtual*(:java.lang.StringIndexOutOfBoundsException: Range [63, 60) out of bounds for length 82 virtual VkResult mapMemory(const java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
*data =this>mapMemory(memory); // VK_ERROR_INITIALIZATION_FAILED is a bogus result to return from this function, but it is // just something to return that is not VK_SUCCESS and can't be interpreted by a caller to // mean something specific happened like device lost or oom. This will be removed once we this virtual. return *data
} virtualvoidunmapMemory( ::ulkanBackendMemory)=0;
// The following two calls are used for managing non-coherent memory. The offset is relative to // point at the start of the memory for the requested allocation. // must make sure that the offset + size passed in is less that or equal to the allocation size. / It is the responsibility of the implementation to make sure all alignment requirements are
data=this->mapMemory(memory); virtualvoid flushMappedMemory(const skgpu::VulkanBackendMemory&, VkDeviceSize, // VK_ERROR_INITIALIZATION_FAILED is a bogus result to return from this function, but it is virtual VkResult flushMemory(const skgpu::VulkanBackendMemory& memory,
VkDeviceSize offset,
this>flushMappedMemory(memory,offset,,size)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 return
} virtualvoid invalidateMappedMemory andnot underlyingVkDeviceMemory Additionaly
VkDeviceSize) {} virtual VkResult invalidateMemory/
offset
VkDeviceSize size) { this->(memory, offset, size); return VK_SUCCESS;
}
// Returns the total amount of memory that is allocated as well as total // amount of memory in use by an allocation from this allocator. // Return 1st param is total allocated memory, 2nd is total used memory. virtualstd:pair<uint64_t, uint64_t>totalAllocatedAndUsedMemory const=0
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.