[Vulkan] Update VMA
This commit is contained in:
parent
4d159efef5
commit
d3b03b9a93
|
@ -310,12 +310,12 @@ TextureCache::Texture* TextureCache::AllocateTexture(
|
||||||
VkImage image;
|
VkImage image;
|
||||||
|
|
||||||
VmaAllocation alloc;
|
VmaAllocation alloc;
|
||||||
VmaMemoryRequirements vma_reqs = {
|
VmaAllocationCreateInfo vma_create_info = {
|
||||||
0, VMA_MEMORY_USAGE_GPU_ONLY, 0, 0, nullptr,
|
0, VMA_MEMORY_USAGE_GPU_ONLY, 0, 0, 0, nullptr, nullptr,
|
||||||
};
|
};
|
||||||
VmaAllocationInfo vma_info = {};
|
VmaAllocationInfo vma_info = {};
|
||||||
VkResult status = vmaCreateImage(mem_allocator_, &image_info, &vma_reqs,
|
VkResult status = vmaCreateImage(mem_allocator_, &image_info,
|
||||||
&image, &alloc, &vma_info);
|
&vma_create_info, &image, &alloc, &vma_info);
|
||||||
if (status != VK_SUCCESS) {
|
if (status != VK_SUCCESS) {
|
||||||
// Allocation failed.
|
// Allocation failed.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -1076,8 +1076,12 @@ bool TextureCache::ConvertTexture(uint8_t* dest, VkBufferImageCopy* copy_region,
|
||||||
switch (src.dimension) {
|
switch (src.dimension) {
|
||||||
case Dimension::k1D:
|
case Dimension::k1D:
|
||||||
assert_always();
|
assert_always();
|
||||||
|
break;
|
||||||
case Dimension::k2D:
|
case Dimension::k2D:
|
||||||
return ConvertTexture2D(dest, copy_region, src);
|
return ConvertTexture2D(dest, copy_region, src);
|
||||||
|
case Dimension::k3D:
|
||||||
|
assert_always();
|
||||||
|
break;
|
||||||
case Dimension::kCube:
|
case Dimension::kCube:
|
||||||
return ConvertTextureCube(dest, copy_region, src);
|
return ConvertTextureCube(dest, copy_region, src);
|
||||||
}
|
}
|
||||||
|
@ -1090,11 +1094,14 @@ bool TextureCache::ComputeTextureStorage(size_t* output_length,
|
||||||
switch (src.dimension) {
|
switch (src.dimension) {
|
||||||
case Dimension::k1D: {
|
case Dimension::k1D: {
|
||||||
assert_always();
|
assert_always();
|
||||||
}
|
} break;
|
||||||
case Dimension::k2D: {
|
case Dimension::k2D: {
|
||||||
*output_length = src.size_2d.input_width * src.size_2d.input_height * 2;
|
*output_length = src.size_2d.input_width * src.size_2d.input_height * 2;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case Dimension::k3D: {
|
||||||
|
assert_always();
|
||||||
|
} break;
|
||||||
case Dimension::kCube: {
|
case Dimension::kCube: {
|
||||||
*output_length =
|
*output_length =
|
||||||
src.size_cube.input_width * src.size_cube.input_height * 2 * 6;
|
src.size_cube.input_width * src.size_cube.input_height * 2 * 6;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue