Merge branch 'master' into vulkan

This commit is contained in:
Triang3l
2020-10-06 21:54:52 +03:00
7 changed files with 289 additions and 124 deletions

View File

@@ -188,12 +188,6 @@ void VulkanSharedMemory::Use(Usage usage,
last_written_range_ = written_range;
}
bool VulkanSharedMemory::EnsureHostGpuMemoryAllocated(uint32_t start,
uint32_t length) {
// TODO(Triang3l): Do sparse binding.
return true;
}
bool VulkanSharedMemory::UploadRanges(
const std::vector<std::pair<uint32_t, uint32_t>>& upload_page_ranges) {
if (upload_page_ranges.empty()) {

View File

@@ -54,8 +54,6 @@ class VulkanSharedMemory : public SharedMemory {
VkBuffer buffer() const { return buffer_; }
protected:
bool EnsureHostGpuMemoryAllocated(uint32_t start, uint32_t length) override;
bool UploadRanges(const std::vector<std::pair<uint32_t, uint32_t>>&
upload_page_ranges) override;
@@ -75,7 +73,8 @@ class VulkanSharedMemory : public SharedMemory {
// Maximum of 1024 allocations in the worst case for all of the buffer because
// of the overall 4096 allocation count limit on Windows drivers.
static constexpr uint32_t kMinBufferAllocationSizeLog2 =
std::max(kOptimalAllocationLog2, kBufferSizeLog2 - 10);
std::max(kHostGpuMemoryOptimalSparseAllocationLog2,
kBufferSizeLog2 - uint32_t(10));
uint32_t buffer_allocation_size_log2_ = kBufferSizeLog2;
// Sparse memory allocations, of different sizes.
std::vector<VkDeviceMemory> buffer_memory_;