Merge pull request #84852 from Alex2782/fix_vulkan_buffer_android
Vulkan: Fix incorrect access to the buffers on Android
This commit is contained in:
commit
a9ba8695d4
|
@ -1365,6 +1365,9 @@ Error RenderingDeviceVulkan::_buffer_allocate(Buffer *p_buffer, uint32_t p_size,
|
||||||
allocInfo.memoryTypeBits = 0;
|
allocInfo.memoryTypeBits = 0;
|
||||||
allocInfo.pool = nullptr;
|
allocInfo.pool = nullptr;
|
||||||
allocInfo.pUserData = nullptr;
|
allocInfo.pUserData = nullptr;
|
||||||
|
if (p_mem_usage == VMA_MEMORY_USAGE_AUTO_PREFER_HOST) {
|
||||||
|
allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||||
|
}
|
||||||
if (p_size <= SMALL_ALLOCATION_MAX_SIZE) {
|
if (p_size <= SMALL_ALLOCATION_MAX_SIZE) {
|
||||||
uint32_t mem_type_index = 0;
|
uint32_t mem_type_index = 0;
|
||||||
vmaFindMemoryTypeIndexForBufferInfo(allocator, &bufferInfo, &allocInfo, &mem_type_index);
|
vmaFindMemoryTypeIndexForBufferInfo(allocator, &bufferInfo, &allocInfo, &mem_type_index);
|
||||||
|
@ -1410,7 +1413,7 @@ Error RenderingDeviceVulkan::_insert_staging_block() {
|
||||||
VmaAllocationCreateInfo allocInfo;
|
VmaAllocationCreateInfo allocInfo;
|
||||||
allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT;
|
allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT;
|
||||||
allocInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST;
|
allocInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST;
|
||||||
allocInfo.requiredFlags = 0;
|
allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||||
allocInfo.preferredFlags = 0;
|
allocInfo.preferredFlags = 0;
|
||||||
allocInfo.memoryTypeBits = 0;
|
allocInfo.memoryTypeBits = 0;
|
||||||
allocInfo.pool = nullptr;
|
allocInfo.pool = nullptr;
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#define _DEBUG
|
#define _DEBUG
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include "vk_mem_alloc.h"
|
#include "thirdparty/vulkan/vk_mem_alloc.h"
|
||||||
|
|
||||||
#ifdef USE_VOLK
|
#ifdef USE_VOLK
|
||||||
#include <volk.h>
|
#include <volk.h>
|
||||||
|
|
Loading…
Reference in New Issue