"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "backends/imgui_impl_vulkan.cpp" between
imgui-1.86.tar.gz and imgui-1.87.tar.gz

About: Dear ImGui is a bloat-free Graphical User Interface for C++ with minimal dependencies.

imgui_impl_vulkan.cpp  (imgui-1.86):imgui_impl_vulkan.cpp  (imgui-1.87)
// dear imgui: Renderer Backend for Vulkan // dear imgui: Renderer Backend for Vulkan
// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, c ustom..) // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, c ustom..)
// Implemented features: // Implemented features:
// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
// Missing features: // [!] Renderer: User texture binding. Use 'VkDescriptorSet' as ImTextureID. Re
// [ ] Renderer: User texture binding. Changes of ImTextureID aren't supported ad the FAQ about ImTextureID! See https://github.com/ocornut/imgui/pull/914 for
by this backend! See https://github.com/ocornut/imgui/pull/914 discussions.
// Important: on 32-bit systems, user texture binding is only supported if your
imconfig file has '#define ImTextureID ImU64'.
// This is because we need ImTextureID to carry a 64-bit value and by default Im
TextureID is defined as void*.
// To build this on 32-bit systems and support texture changes:
// - [Solution 1] IDE/msbuild: in "Properties/C++/Preprocessor Definitions" add
'ImTextureID=ImU64' (this is what we do in our .vcxproj files)
// - [Solution 2] IDE/msbuild: in "Properties/C++/Preprocessor Definitions" add
'IMGUI_USER_CONFIG="my_imgui_config.h"' and inside 'my_imgui_config.h' add '#def
ine ImTextureID ImU64' and as many other options as you like.
// - [Solution 3] IDE/msbuild: edit imconfig.h and add '#define ImTextureID ImU6
4' (prefer solution 2 to create your own config file!)
// - [Solution 4] command-line: add '/D ImTextureID=ImU64' to your cl.exe comman
d-line (this is what we do in our batch files)
// You can use unmodified imgui_impl_* files in your project. See examples/ fold er for examples of using this. // You can use unmodified imgui_impl_* files in your project. See examples/ fold er for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
// Read online: https://github.com/ocornut/imgui/tree/master/docs // Read online: https://github.com/ocornut/imgui/tree/master/docs
// The aim of imgui_impl_vulkan.h/.cpp is to be usable in your engine without an y modification. // The aim of imgui_impl_vulkan.h/.cpp is to be usable in your engine without an y modification.
// IF YOU FEEL YOU NEED TO MAKE ANY CHANGE TO THIS CODE, please share them and y our feedback at https://github.com/ocornut/imgui/ // IF YOU FEEL YOU NEED TO MAKE ANY CHANGE TO THIS CODE, please share them and y our feedback at https://github.com/ocornut/imgui/
// Important note to the reader who wish to integrate imgui_impl_vulkan.cpp/.h i n their own engine/app. // Important note to the reader who wish to integrate imgui_impl_vulkan.cpp/.h i n their own engine/app.
skipping to change at line 60 skipping to change at line 67
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback, ImGui_ImplVul kan_Render() calls ImGui_ImplVulkan_RenderDrawData() itself. // 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback, ImGui_ImplVul kan_Render() calls ImGui_ImplVulkan_RenderDrawData() itself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available f rom 1.60 WIP, user needs to call CreateContext/DestroyContext themselves. // 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available f rom 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2017-05-15: Vulkan: Fix scissor offset being negative. Fix new Vulkan valida tion warnings. Set required depth member for buffer image copy. // 2017-05-15: Vulkan: Fix scissor offset being negative. Fix new Vulkan valida tion warnings. Set required depth member for buffer image copy.
// 2016-11-13: Vulkan: Fix validation layer warnings and errors and redeclare g l_PerVertex. // 2016-11-13: Vulkan: Fix validation layer warnings and errors and redeclare g l_PerVertex.
// 2016-10-18: Vulkan: Add location decorators & change to use structs as in/ou t in glsl, update embedded spv (produced with glslangValidator -x). Null the rel eased resources. // 2016-10-18: Vulkan: Add location decorators & change to use structs as in/ou t in glsl, update embedded spv (produced with glslangValidator -x). Null the rel eased resources.
// 2016-08-27: Vulkan: Fix Vulkan example for use when a depth buffer is active . // 2016-08-27: Vulkan: Fix Vulkan example for use when a depth buffer is active .
#include "imgui_impl_vulkan.h" #include "imgui_impl_vulkan.h"
#include <stdio.h> #include <stdio.h>
// Visual Studio warnings
#ifdef _MSC_VER
#pragma warning (disable: 4127) // condition expression is constant
#endif
// Reusable buffers used for rendering 1 current in-flight frame, for ImGui_Impl Vulkan_RenderDrawData() // Reusable buffers used for rendering 1 current in-flight frame, for ImGui_Impl Vulkan_RenderDrawData()
// [Please zero-clear before use!] // [Please zero-clear before use!]
struct ImGui_ImplVulkanH_FrameRenderBuffers struct ImGui_ImplVulkanH_FrameRenderBuffers
{ {
VkDeviceMemory VertexBufferMemory; VkDeviceMemory VertexBufferMemory;
VkDeviceMemory IndexBufferMemory; VkDeviceMemory IndexBufferMemory;
VkDeviceSize VertexBufferSize; VkDeviceSize VertexBufferSize;
VkDeviceSize IndexBufferSize; VkDeviceSize IndexBufferSize;
VkBuffer VertexBuffer; VkBuffer VertexBuffer;
VkBuffer IndexBuffer; VkBuffer IndexBuffer;
skipping to change at line 90 skipping to change at line 102
// Vulkan data // Vulkan data
struct ImGui_ImplVulkan_Data struct ImGui_ImplVulkan_Data
{ {
ImGui_ImplVulkan_InitInfo VulkanInitInfo; ImGui_ImplVulkan_InitInfo VulkanInitInfo;
VkRenderPass RenderPass; VkRenderPass RenderPass;
VkDeviceSize BufferMemoryAlignment; VkDeviceSize BufferMemoryAlignment;
VkPipelineCreateFlags PipelineCreateFlags; VkPipelineCreateFlags PipelineCreateFlags;
VkDescriptorSetLayout DescriptorSetLayout; VkDescriptorSetLayout DescriptorSetLayout;
VkPipelineLayout PipelineLayout; VkPipelineLayout PipelineLayout;
VkDescriptorSet DescriptorSet;
VkPipeline Pipeline; VkPipeline Pipeline;
uint32_t Subpass; uint32_t Subpass;
VkShaderModule ShaderModuleVert; VkShaderModule ShaderModuleVert;
VkShaderModule ShaderModuleFrag; VkShaderModule ShaderModuleFrag;
// Font data // Font data
VkSampler FontSampler; VkSampler FontSampler;
VkDeviceMemory FontMemory; VkDeviceMemory FontMemory;
VkImage FontImage; VkImage FontImage;
VkImageView FontView; VkImageView FontView;
VkDescriptorSet FontDescriptorSet;
VkDeviceMemory UploadBufferMemory; VkDeviceMemory UploadBufferMemory;
VkBuffer UploadBuffer; VkBuffer UploadBuffer;
// Render buffers // Render buffers
ImGui_ImplVulkanH_WindowRenderBuffers MainWindowRenderBuffers; ImGui_ImplVulkanH_WindowRenderBuffers MainWindowRenderBuffers;
ImGui_ImplVulkan_Data() ImGui_ImplVulkan_Data()
{ {
memset(this, 0, sizeof(*this)); memset(this, 0, sizeof(*this));
BufferMemoryAlignment = 256; BufferMemoryAlignment = 256;
skipping to change at line 379 skipping to change at line 391
err = vkBindBufferMemory(v->Device, buffer, buffer_memory, 0); err = vkBindBufferMemory(v->Device, buffer, buffer_memory, 0);
check_vk_result(err); check_vk_result(err);
p_buffer_size = req.size; p_buffer_size = req.size;
} }
static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline pipeline, VkCommandBuffer command_buffer, ImGui_ImplVulkanH_FrameRenderBuffers* rb, int fb_width, int fb_height) static void ImGui_ImplVulkan_SetupRenderState(ImDrawData* draw_data, VkPipeline pipeline, VkCommandBuffer command_buffer, ImGui_ImplVulkanH_FrameRenderBuffers* rb, int fb_width, int fb_height)
{ {
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData(); ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
// Bind pipeline and descriptor sets: // Bind pipeline:
{ {
vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipel ine); vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipel ine);
VkDescriptorSet desc_set[1] = { bd->DescriptorSet };
vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
bd->PipelineLayout, 0, 1, desc_set, 0, NULL);
} }
// Bind Vertex And Index Buffer: // Bind Vertex And Index Buffer:
if (draw_data->TotalVtxCount > 0) if (draw_data->TotalVtxCount > 0)
{ {
VkBuffer vertex_buffers[1] = { rb->VertexBuffer }; VkBuffer vertex_buffers[1] = { rb->VertexBuffer };
VkDeviceSize vertex_offset[1] = { 0 }; VkDeviceSize vertex_offset[1] = { 0 };
vkCmdBindVertexBuffers(command_buffer, 0, 1, vertex_buffers, vertex_offs et); vkCmdBindVertexBuffers(command_buffer, 0, 1, vertex_buffers, vertex_offs et);
vkCmdBindIndexBuffer(command_buffer, rb->IndexBuffer, 0, sizeof(ImDrawId x) == 2 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32); vkCmdBindIndexBuffer(command_buffer, rb->IndexBuffer, 0, sizeof(ImDrawId x) == 2 ? VK_INDEX_TYPE_UINT16 : VK_INDEX_TYPE_UINT32);
} }
skipping to change at line 534 skipping to change at line 544
continue; continue;
// Apply scissor/clipping rectangle // Apply scissor/clipping rectangle
VkRect2D scissor; VkRect2D scissor;
scissor.offset.x = (int32_t)(clip_min.x); scissor.offset.x = (int32_t)(clip_min.x);
scissor.offset.y = (int32_t)(clip_min.y); scissor.offset.y = (int32_t)(clip_min.y);
scissor.extent.width = (uint32_t)(clip_max.x - clip_min.x); scissor.extent.width = (uint32_t)(clip_max.x - clip_min.x);
scissor.extent.height = (uint32_t)(clip_max.y - clip_min.y); scissor.extent.height = (uint32_t)(clip_max.y - clip_min.y);
vkCmdSetScissor(command_buffer, 0, 1, &scissor); vkCmdSetScissor(command_buffer, 0, 1, &scissor);
// Bind DescriptorSet with font or user texture
VkDescriptorSet desc_set[1] = { (VkDescriptorSet)pcmd->TextureId
};
if (sizeof(ImTextureID) < sizeof(ImU64))
{
// We don't support texture switches if ImTextureID hasn't b
een redefined to be 64-bit. Do a flaky check that other textures haven't been us
ed.
IM_ASSERT(pcmd->TextureId == (ImTextureID)bd->FontDescriptor
Set);
desc_set[0] = bd->FontDescriptorSet;
}
vkCmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_G
RAPHICS, bd->PipelineLayout, 0, 1, desc_set, 0, NULL);
// Draw // Draw
vkCmdDrawIndexed(command_buffer, pcmd->ElemCount, 1, pcmd->IdxOf fset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset, 0); vkCmdDrawIndexed(command_buffer, pcmd->ElemCount, 1, pcmd->IdxOf fset + global_idx_offset, pcmd->VtxOffset + global_vtx_offset, 0);
} }
} }
global_idx_offset += cmd_list->IdxBuffer.Size; global_idx_offset += cmd_list->IdxBuffer.Size;
global_vtx_offset += cmd_list->VtxBuffer.Size; global_vtx_offset += cmd_list->VtxBuffer.Size;
} }
// Note: at this point both vkCmdSetViewport() and vkCmdSetScissor() have be en called. // Note: at this point both vkCmdSetViewport() and vkCmdSetScissor() have be en called.
// Our last values will leak into user/application rendering IF: // Our last values will leak into user/application rendering IF:
skipping to change at line 610 skipping to change at line 630
info.image = bd->FontImage; info.image = bd->FontImage;
info.viewType = VK_IMAGE_VIEW_TYPE_2D; info.viewType = VK_IMAGE_VIEW_TYPE_2D;
info.format = VK_FORMAT_R8G8B8A8_UNORM; info.format = VK_FORMAT_R8G8B8A8_UNORM;
info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
info.subresourceRange.levelCount = 1; info.subresourceRange.levelCount = 1;
info.subresourceRange.layerCount = 1; info.subresourceRange.layerCount = 1;
err = vkCreateImageView(v->Device, &info, v->Allocator, &bd->FontView); err = vkCreateImageView(v->Device, &info, v->Allocator, &bd->FontView);
check_vk_result(err); check_vk_result(err);
} }
// Update the Descriptor Set: // Create the Descriptor Set:
{ bd->FontDescriptorSet = (VkDescriptorSet)ImGui_ImplVulkan_AddTexture(bd->Fon
VkDescriptorImageInfo desc_image[1] = {}; tSampler, bd->FontView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
desc_image[0].sampler = bd->FontSampler;
desc_image[0].imageView = bd->FontView;
desc_image[0].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
VkWriteDescriptorSet write_desc[1] = {};
write_desc[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
write_desc[0].dstSet = bd->DescriptorSet;
write_desc[0].descriptorCount = 1;
write_desc[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
;
write_desc[0].pImageInfo = desc_image;
vkUpdateDescriptorSets(v->Device, 1, write_desc, 0, NULL);
}
// Create the Upload Buffer: // Create the Upload Buffer:
{ {
VkBufferCreateInfo buffer_info = {}; VkBufferCreateInfo buffer_info = {};
buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
buffer_info.size = upload_size; buffer_info.size = upload_size;
buffer_info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT; buffer_info.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
buffer_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE; buffer_info.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
err = vkCreateBuffer(v->Device, &buffer_info, v->Allocator, &bd->UploadB uffer); err = vkCreateBuffer(v->Device, &buffer_info, v->Allocator, &bd->UploadB uffer);
check_vk_result(err); check_vk_result(err);
skipping to change at line 701 skipping to change at line 709
use_barrier[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; use_barrier[0].srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
use_barrier[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; use_barrier[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
use_barrier[0].image = bd->FontImage; use_barrier[0].image = bd->FontImage;
use_barrier[0].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; use_barrier[0].subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
use_barrier[0].subresourceRange.levelCount = 1; use_barrier[0].subresourceRange.levelCount = 1;
use_barrier[0].subresourceRange.layerCount = 1; use_barrier[0].subresourceRange.layerCount = 1;
vkCmdPipelineBarrier(command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, NULL, 0, NULL, 1, use_barrier); vkCmdPipelineBarrier(command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_ PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, NULL, 0, NULL, 1, use_barrier);
} }
// Store our identifier // Store our identifier
io.Fonts->SetTexID((ImTextureID)(intptr_t)bd->FontImage); io.Fonts->SetTexID((ImTextureID)bd->FontDescriptorSet);
return true; return true;
} }
static void ImGui_ImplVulkan_CreateShaderModules(VkDevice device, const VkAlloca tionCallbacks* allocator) static void ImGui_ImplVulkan_CreateShaderModules(VkDevice device, const VkAlloca tionCallbacks* allocator)
{ {
// Create the shader modules // Create the shader modules
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData(); ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
if (bd->ShaderModuleVert == VK_NULL_HANDLE) if (bd->ShaderModuleVert == VK_NULL_HANDLE)
{ {
skipping to change at line 940 skipping to change at line 948
binding[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; binding[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
binding[0].pImmutableSamplers = sampler; binding[0].pImmutableSamplers = sampler;
VkDescriptorSetLayoutCreateInfo info = {}; VkDescriptorSetLayoutCreateInfo info = {};
info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
info.bindingCount = 1; info.bindingCount = 1;
info.pBindings = binding; info.pBindings = binding;
err = vkCreateDescriptorSetLayout(v->Device, &info, v->Allocator, &bd->D escriptorSetLayout); err = vkCreateDescriptorSetLayout(v->Device, &info, v->Allocator, &bd->D escriptorSetLayout);
check_vk_result(err); check_vk_result(err);
} }
// Create Descriptor Set:
{
VkDescriptorSetAllocateInfo alloc_info = {};
alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
alloc_info.descriptorPool = v->DescriptorPool;
alloc_info.descriptorSetCount = 1;
alloc_info.pSetLayouts = &bd->DescriptorSetLayout;
err = vkAllocateDescriptorSets(v->Device, &alloc_info, &bd->DescriptorSe
t);
check_vk_result(err);
}
if (!bd->PipelineLayout) if (!bd->PipelineLayout)
{ {
// Constants: we are using 'vec2 offset' and 'vec2 scale' instead of a f ull 3d projection matrix // Constants: we are using 'vec2 offset' and 'vec2 scale' instead of a f ull 3d projection matrix
VkPushConstantRange push_constants[1] = {}; VkPushConstantRange push_constants[1] = {};
push_constants[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT; push_constants[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
push_constants[0].offset = sizeof(float) * 0; push_constants[0].offset = sizeof(float) * 0;
push_constants[0].size = sizeof(float) * 4; push_constants[0].size = sizeof(float) * 4;
VkDescriptorSetLayout set_layout[1] = { bd->DescriptorSetLayout }; VkDescriptorSetLayout set_layout[1] = { bd->DescriptorSetLayout };
VkPipelineLayoutCreateInfo layout_info = {}; VkPipelineLayoutCreateInfo layout_info = {};
layout_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; layout_info.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
skipping to change at line 1093 skipping to change at line 1090
if (bd->VulkanInitInfo.MinImageCount == min_image_count) if (bd->VulkanInitInfo.MinImageCount == min_image_count)
return; return;
ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo; ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
VkResult err = vkDeviceWaitIdle(v->Device); VkResult err = vkDeviceWaitIdle(v->Device);
check_vk_result(err); check_vk_result(err);
ImGui_ImplVulkanH_DestroyWindowRenderBuffers(v->Device, &bd->MainWindowRende rBuffers, v->Allocator); ImGui_ImplVulkanH_DestroyWindowRenderBuffers(v->Device, &bd->MainWindowRende rBuffers, v->Allocator);
bd->VulkanInitInfo.MinImageCount = min_image_count; bd->VulkanInitInfo.MinImageCount = min_image_count;
} }
// Register a texture
// FIXME: This is experimental in the sense that we are unsure how to best desig
n/tackle this problem, please post to https://github.com/ocornut/imgui/pull/914
if you have suggestions.
VkDescriptorSet ImGui_ImplVulkan_AddTexture(VkSampler sampler, VkImageView image
_view, VkImageLayout image_layout)
{
ImGui_ImplVulkan_Data* bd = ImGui_ImplVulkan_GetBackendData();
ImGui_ImplVulkan_InitInfo* v = &bd->VulkanInitInfo;
// Create Descriptor Set:
VkDescriptorSet descriptor_set;
{
VkDescriptorSetAllocateInfo alloc_info = {};
alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
alloc_info.descriptorPool = v->DescriptorPool;
alloc_info.descriptorSetCount = 1;
alloc_info.pSetLayouts = &bd->DescriptorSetLayout;
VkResult err = vkAllocateDescriptorSets(v->Device, &alloc_info, &descrip
tor_set);
check_vk_result(err);
}
// Update the Descriptor Set:
{
VkDescriptorImageInfo desc_image[1] = {};
desc_image[0].sampler = sampler;
desc_image[0].imageView = image_view;
desc_image[0].imageLayout = image_layout;
VkWriteDescriptorSet write_desc[1] = {};
write_desc[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
write_desc[0].dstSet = descriptor_set;
write_desc[0].descriptorCount = 1;
write_desc[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
;
write_desc[0].pImageInfo = desc_image;
vkUpdateDescriptorSets(v->Device, 1, write_desc, 0, NULL);
}
return descriptor_set;
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// Internal / Miscellaneous Vulkan Helpers // Internal / Miscellaneous Vulkan Helpers
// (Used by example's main.cpp. Used by multi-viewport features. PROBABLY NOT us ed by your own app.) // (Used by example's main.cpp. Used by multi-viewport features. PROBABLY NOT us ed by your own app.)
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// You probably do NOT need to use or care about those functions. // You probably do NOT need to use or care about those functions.
// Those functions only exist because: // Those functions only exist because:
// 1) they facilitate the readability and maintenance of the multiple main.cpp examples files. // 1) they facilitate the readability and maintenance of the multiple main.cpp examples files.
// 2) the upcoming multi-viewport feature will need them internally. // 2) the upcoming multi-viewport feature will need them internally.
// Generally we avoid exposing any kind of superfluous high-level helpers in the backends, // Generally we avoid exposing any kind of superfluous high-level helpers in the backends,
// but it is too much code to duplicate everywhere so we exceptionally expose th em. // but it is too much code to duplicate everywhere so we exceptionally expose th em.
 End of changes. 11 change blocks. 
36 lines changed or deleted 85 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)