Vulkan: Push constants #104880

Merged
Jeroen Bakker merged 73 commits from Jeroen-Bakker/blender:vulkan-push-constants into main 2023-03-06 12:29:06 +01:00
2 changed files with 23 additions and 6 deletions
Showing only changes of commit 380e69148e - Show all commits

View File

@ -54,6 +54,11 @@ class VKContext : public Context {
return static_cast<VKContext *>(Context::get());
}
VkPhysicalDevice physical_device_get() const
{
return vk_physical_device_;
}
VkDevice device_get() const
{
return vk_device_;

View File

@ -165,12 +165,24 @@ bool VKTexture::allocate()
VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT);
allocCreateInfo.priority = 1.0f;
VkResult result = vmaCreateImage(context.mem_allocator_get(),
&image_info,
&allocCreateInfo,
&vk_image_,
&allocation_,
nullptr);
VkImageFormatProperties image_format = {};
VkResult result = vkGetPhysicalDeviceImageFormatProperties(context.physical_device_get(),
image_info.format,
image_info.imageType,
image_info.tiling,
image_info.usage,
image_info.flags,
&image_format);
if (result != VK_SUCCESS) {
return false;
}
result = vmaCreateImage(context.mem_allocator_get(),
&image_info,
&allocCreateInfo,
&vk_image_,
&allocation_,
nullptr);
if (result != VK_SUCCESS) {
return false;
}