Skip to content

Commit 0c5de0d

Browse files
committed
auto
1 parent f4bb3d7 commit 0c5de0d

13 files changed

Lines changed: 99 additions & 77 deletions

File tree

Framework/Renderer/Vulkan/VulkanTexture.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,7 @@ void UImGui::VulkanTexture::load(TextureData& dt, void* data, FVector2 size, uin
9898
return;
9999
}
100100

101-
const vk::SamplerCreateInfo samplerCreateInfo
102-
{
103-
.sType = vk::StructureType::eSamplerCreateInfo,
104-
.magFilter = dt.bFiltered ? vk::Filter::eLinear : vk::Filter::eNearest,
105-
.minFilter = dt.bFiltered ? vk::Filter::eLinear : vk::Filter::eNearest,
106-
.mipmapMode = vk::SamplerMipmapMode::eLinear,
107-
.addressModeU = vk::SamplerAddressMode::eRepeat,
108-
.addressModeV = vk::SamplerAddressMode::eRepeat,
109-
.addressModeW = vk::SamplerAddressMode::eRepeat,
110-
.maxAnisotropy = 1.0f,
111-
.minLod = -1000,
112-
.maxLod = 1000,
113-
};
114-
result = device.createSampler(&samplerCreateInfo, nullptr, &texDt->sampler);
115-
if (result != vk::Result::eSuccess)
116-
{
117-
Logger::log("Couldn't create image sampler for Vulkan texture at location: ", ULOG_LOG_TYPE_WARNING, dt.filename);
118-
return;
119-
}
120-
121-
texDt->descriptorSet = ImGui_ImplVulkan_AddTexture(texDt->sampler, texDt->imageView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
101+
texDt->descriptorSet = ImGui_ImplVulkan_AddTexture(texDt->imageView, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
122102

123103
const vk::BufferCreateInfo bufferCreateInfo =
124104
{
@@ -296,7 +276,6 @@ void UImGui::VulkanTexture::clear(TextureData& dt) noexcept
296276

297277
device.freeMemory(texDt->uploadBufferMemory, nullptr);
298278
device.destroyBuffer(texDt->uploadBuffer, nullptr);
299-
device.destroySampler(texDt->sampler, nullptr);
300279
device.destroyImageView(texDt->imageView, nullptr);
301280
device.destroyImage(texDt->image, nullptr);
302281
device.freeMemory(texDt->imageMemory, nullptr);

Framework/Renderer/Vulkan/VulkanTexture.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ namespace UImGui
3434
vk::ImageView imageView{};
3535
vk::Image image{};
3636
vk::DeviceMemory imageMemory{};
37-
vk::Sampler sampler{};
3837
vk::Buffer uploadBuffer{};
3938
vk::DeviceMemory uploadBufferMemory{};
4039
};

Framework/ThirdParty/source-libraries/cimgui/cimgui.cpp

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,14 +3294,34 @@ CIMGUI_API void cimgui::ImDrawList_AddLineEx(cimgui::ImDrawList* self, ci
32943294
reinterpret_cast<::ImDrawList*>(self)->AddLine(ConvertToCPP_ImVec2(p1), ConvertToCPP_ImVec2(p2), col, thickness);
32953295
}
32963296

3297+
CIMGUI_API void cimgui::ImDrawList_AddLineH(cimgui::ImDrawList* self, float min_x, float max_x, float y, ImU32 col)
3298+
{
3299+
reinterpret_cast<::ImDrawList*>(self)->AddLineH(min_x, max_x, y, col);
3300+
}
3301+
3302+
CIMGUI_API void cimgui::ImDrawList_AddLineHEx(cimgui::ImDrawList* self, float min_x, float max_x, float y, ImU32 col, float thickness)
3303+
{
3304+
reinterpret_cast<::ImDrawList*>(self)->AddLineH(min_x, max_x, y, col, thickness);
3305+
}
3306+
3307+
CIMGUI_API void cimgui::ImDrawList_AddLineV(cimgui::ImDrawList* self, float x, float min_y, float max_y, ImU32 col)
3308+
{
3309+
reinterpret_cast<::ImDrawList*>(self)->AddLineV(x, min_y, max_y, col);
3310+
}
3311+
3312+
CIMGUI_API void cimgui::ImDrawList_AddLineVEx(cimgui::ImDrawList* self, float x, float min_y, float max_y, ImU32 col, float thickness)
3313+
{
3314+
reinterpret_cast<::ImDrawList*>(self)->AddLineV(x, min_y, max_y, col, thickness);
3315+
}
3316+
32973317
CIMGUI_API void cimgui::ImDrawList_AddRect(cimgui::ImDrawList* self, cimgui::ImVec2 p_min, cimgui::ImVec2 p_max, ImU32 col)
32983318
{
32993319
reinterpret_cast<::ImDrawList*>(self)->AddRect(ConvertToCPP_ImVec2(p_min), ConvertToCPP_ImVec2(p_max), col);
33003320
}
33013321

3302-
CIMGUI_API void cimgui::ImDrawList_AddRectEx(cimgui::ImDrawList* self, cimgui::ImVec2 p_min, cimgui::ImVec2 p_max, ImU32 col, float rounding, ImDrawFlags flags, float thickness)
3322+
CIMGUI_API void cimgui::ImDrawList_AddRectEx(cimgui::ImDrawList* self, cimgui::ImVec2 p_min, cimgui::ImVec2 p_max, ImU32 col, float rounding, float thickness, ImDrawFlags flags)
33033323
{
3304-
reinterpret_cast<::ImDrawList*>(self)->AddRect(ConvertToCPP_ImVec2(p_min), ConvertToCPP_ImVec2(p_max), col, rounding, flags, thickness);
3324+
reinterpret_cast<::ImDrawList*>(self)->AddRect(ConvertToCPP_ImVec2(p_min), ConvertToCPP_ImVec2(p_max), col, rounding, thickness, flags);
33053325
}
33063326

33073327
CIMGUI_API void cimgui::ImDrawList_AddRectFilled(cimgui::ImDrawList* self, cimgui::ImVec2 p_min, cimgui::ImVec2 p_max, ImU32 col)
@@ -3429,9 +3449,9 @@ CIMGUI_API void cimgui::ImDrawList_AddBezierQuadratic(cimgui::ImDrawList*
34293449
reinterpret_cast<::ImDrawList*>(self)->AddBezierQuadratic(ConvertToCPP_ImVec2(p1), ConvertToCPP_ImVec2(p2), ConvertToCPP_ImVec2(p3), col, thickness, num_segments);
34303450
}
34313451

3432-
CIMGUI_API void cimgui::ImDrawList_AddPolyline(cimgui::ImDrawList* self, const cimgui::ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness)
3452+
CIMGUI_API void cimgui::ImDrawList_AddPolyline(cimgui::ImDrawList* self, const cimgui::ImVec2* points, int num_points, ImU32 col, float thickness, ImDrawFlags flags)
34333453
{
3434-
reinterpret_cast<::ImDrawList*>(self)->AddPolyline(reinterpret_cast<const ::ImVec2*>(points), num_points, col, flags, thickness);
3454+
reinterpret_cast<::ImDrawList*>(self)->AddPolyline(reinterpret_cast<const ::ImVec2*>(points), num_points, col, thickness, flags);
34353455
}
34363456

34373457
CIMGUI_API void cimgui::ImDrawList_AddConvexPolyFilled(cimgui::ImDrawList* self, const cimgui::ImVec2* points, int num_points, ImU32 col)
@@ -3494,9 +3514,9 @@ CIMGUI_API void cimgui::ImDrawList_PathFillConcave(cimgui::ImDrawList* se
34943514
reinterpret_cast<::ImDrawList*>(self)->PathFillConcave(col);
34953515
}
34963516

3497-
CIMGUI_API void cimgui::ImDrawList_PathStroke(cimgui::ImDrawList* self, ImU32 col, ImDrawFlags flags, float thickness)
3517+
CIMGUI_API void cimgui::ImDrawList_PathStroke(cimgui::ImDrawList* self, ImU32 col, float thickness, ImDrawFlags flags)
34983518
{
3499-
reinterpret_cast<::ImDrawList*>(self)->PathStroke(col, flags, thickness);
3519+
reinterpret_cast<::ImDrawList*>(self)->PathStroke(col, thickness, flags);
35003520
}
35013521

35023522
CIMGUI_API void cimgui::ImDrawList_PathArcTo(cimgui::ImDrawList* self, cimgui::ImVec2 center, float radius, float a_min, float a_max, int num_segments)
@@ -3611,6 +3631,21 @@ CIMGUI_API void cimgui::ImDrawList_PrimVtx(cimgui::ImDrawList* self, cimg
36113631

36123632
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
36133633

3634+
CIMGUI_API void cimgui::ImDrawList_AddRectImDrawFlags(cimgui::ImDrawList* self, cimgui::ImVec2 p_min, cimgui::ImVec2 p_max, ImU32 col, float rounding, ImDrawFlags flags, float thickness)
3635+
{
3636+
reinterpret_cast<::ImDrawList*>(self)->AddRect(ConvertToCPP_ImVec2(p_min), ConvertToCPP_ImVec2(p_max), col, rounding, flags, thickness);
3637+
}
3638+
3639+
CIMGUI_API void cimgui::ImDrawList_AddPolylineImDrawFlags(cimgui::ImDrawList* self, const cimgui::ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness)
3640+
{
3641+
reinterpret_cast<::ImDrawList*>(self)->AddPolyline(reinterpret_cast<const ::ImVec2*>(points), num_points, col, flags, thickness);
3642+
}
3643+
3644+
CIMGUI_API void cimgui::ImDrawList_PathStrokeImDrawFlags(cimgui::ImDrawList* self, ImU32 col, ImDrawFlags flags, float thickness)
3645+
{
3646+
reinterpret_cast<::ImDrawList*>(self)->PathStroke(col, flags, thickness);
3647+
}
3648+
36143649
CIMGUI_API void cimgui::ImDrawList_PushTextureID(cimgui::ImDrawList* self, cimgui::ImTextureRef tex_ref)
36153650
{
36163651
reinterpret_cast<::ImDrawList*>(self)->PushTextureID(ConvertToCPP_ImTextureRef(tex_ref));

0 commit comments

Comments
 (0)