Vulkan: Push constants #104880
|
@ -54,6 +54,11 @@ class VKContext : public Context {
|
||||||
return static_cast<VKContext *>(Context::get());
|
return static_cast<VKContext *>(Context::get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VkPhysicalDevice physical_device_get() const
|
||||||
|
{
|
||||||
|
return vk_physical_device_;
|
||||||
|
}
|
||||||
|
|
||||||
VkDevice device_get() const
|
VkDevice device_get() const
|
||||||
{
|
{
|
||||||
return vk_device_;
|
return vk_device_;
|
||||||
|
|
|
@ -165,12 +165,24 @@ bool VKTexture::allocate()
|
||||||
VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT);
|
VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT);
|
||||||
allocCreateInfo.priority = 1.0f;
|
allocCreateInfo.priority = 1.0f;
|
||||||
|
|
||||||
VkResult result = vmaCreateImage(context.mem_allocator_get(),
|
VkImageFormatProperties image_format = {};
|
||||||
&image_info,
|
VkResult result = vkGetPhysicalDeviceImageFormatProperties(context.physical_device_get(),
|
||||||
&allocCreateInfo,
|
image_info.format,
|
||||||
&vk_image_,
|
image_info.imageType,
|
||||||
&allocation_,
|
image_info.tiling,
|
||||||
nullptr);
|
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) {
|
if (result != VK_SUCCESS) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue