Skip to content

Commit 9da718e

Browse files
committed
add last vk_shader source code back
1 parent 2fc7c42 commit 9da718e

File tree

463 files changed

+57338
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

463 files changed

+57338
-70
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,20 @@ set_target_properties(
9999

100100
include_directories(${IMGUI_INCLUDE_DIRS})
101101

102+
if(IMGUI_VULKAN_SHADER)
103+
set_target_properties(
104+
VkShader
105+
PROPERTIES
106+
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
107+
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
108+
)
109+
endif()
110+
111+
include_directories(
112+
${CMAKE_CURRENT_BINARY_DIR}
113+
${PROJECT_BINARY_DIR}
114+
)
115+
102116
add_subdirectory(blueprintsdk)
103117
set_target_properties(
104118
BluePrintSDK

MediaEditor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
#include <imgui_addons/ImGuiTabWindow.h>
2727
#include <ImMaskCreator/ImMaskCreator.h>
2828
#if IMGUI_VULKAN_SHADER
29-
#include <ImVulkanShader/shader/scopes/Histogram_vulkan.h>
30-
#include <ImVulkanShader/shader/scopes/Waveform_vulkan.h>
31-
#include <ImVulkanShader/shader/scopes/CIE_vulkan.h>
32-
#include <ImVulkanShader/shader/scopes/Vector_vulkan.h>
29+
#include <Histogram_vulkan.h>
30+
#include <Waveform_vulkan.h>
31+
#include <CIE_vulkan.h>
32+
#include <Vector_vulkan.h>
3333
#endif
3434
#include <BaseUtils/FileSystemUtils.h>
3535
#include <BaseUtils/ThreadUtils.h>

extralib/include/MediaCore/FFUtils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
#include <imconfig.h>
2424
#include <immat.h>
2525
#if IMGUI_VULKAN_SHADER
26-
#include <ImVulkanShader/ImVulkanShader.h>
27-
#include <ImVulkanShader/shader/internals/ColorConvert_vulkan.h>
28-
#include <ImVulkanShader/shader/internals/Resize_vulkan.h>
26+
#include <ImVulkanShader.h>
27+
#include <ColorConvert_vulkan.h>
28+
#include <Resize_vulkan.h>
2929
#endif
3030
extern "C"
3131
{

extralib/lib/Linux/libVkShader.so

-6.9 MB
Binary file not shown.
-3.44 MB
Binary file not shown.
-3.55 MB
Binary file not shown.

extralib/lib/Win32/libVkShader.dll

-4.8 MB
Binary file not shown.

imgui/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,20 @@ set(IMGUI_INC_DIRS
965965
${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype
966966
)
967967

968+
# imgui_vk_shader
969+
if(IMGUI_VULKAN_SHADER)
970+
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
971+
add_subdirectory(misc/imgui_vkshader)
972+
set(IMGUI_INC_DIRS
973+
${IMGUI_INC_DIRS}
974+
${VKSHADER_INCLUDE_DIRS}
975+
)
976+
set(LINK_LIBS
977+
${LINK_LIBS}
978+
${VKSHADER_LIBRARYS}
979+
)
980+
endif(IMGUI_VULKAN_SHADER)
981+
968982
include_directories(${IMGUI_INC_DIRS})
969983

970984
# ZLib

imgui/imgui_texture.cpp

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "imgui_texture.h"
22
#include "imgui_helper.h"
33
#include <thread>
4-
#if IMGUI_VULKAN_SHADER
5-
#include "ImVulkanShader.h"
6-
#endif
4+
//#if IMGUI_VULKAN_SHADER
5+
//#include "ImVulkanShader.h"
6+
//#endif
77
#if IMGUI_TIFF
88
#include <tiffio.h>
99
#endif
@@ -314,18 +314,18 @@ void ImGenerateOrUpdateTexture(ImTextureID& imtexid,int width,int height,int cha
314314
if (is_immat)
315315
{
316316
ImGui::ImMat *mat = (ImGui::ImMat*)pixels;
317-
#if IMGUI_VULKAN_SHADER
318-
if (mat->device == IM_DD_VULKAN)
319-
{
320-
ImGui::VkMat * vkmat = (ImGui::VkMat*)mat;
321-
if (!vkmat->empty())
322-
{
323-
auto data = ImGui::ImVulkanVkMatMapping(*vkmat);
324-
if (data) glTexImage2D(GL_TEXTURE_2D, 0, ifmt, width, height, 0, fmt, mat->type == IM_DT_FLOAT32 ? GL_FLOAT : mat->type == IM_DT_INT16 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE, data);
325-
}
326-
}
327-
else
328-
#endif
317+
//#if IMGUI_VULKAN_SHADER
318+
// if (mat->device == IM_DD_VULKAN)
319+
// {
320+
// ImGui::VkMat * vkmat = (ImGui::VkMat*)mat;
321+
// if (!vkmat->empty())
322+
// {
323+
// auto data = ImGui::ImVulkanVkMatMapping(*vkmat);
324+
// if (data) glTexImage2D(GL_TEXTURE_2D, 0, ifmt, width, height, 0, fmt, mat->type == IM_DT_FLOAT32 ? GL_FLOAT : mat->type == IM_DT_INT16 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE, data);
325+
// }
326+
// }
327+
// else
328+
//#endif
329329
if (mat->device == IM_DD_CPU)
330330
{
331331
glTexImage2D(GL_TEXTURE_2D, 0, ifmt, width, height, 0, fmt, mat->type == IM_DT_FLOAT32 ? GL_FLOAT : mat->type == IM_DT_INT16 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE, mat->data);
@@ -441,18 +441,18 @@ void ImCopyToTexture(ImTextureID& imtexid, unsigned char* pixels, int width, int
441441
{
442442
ImGui::ImMat *mat = (ImGui::ImMat*)pixels;
443443
auto src_format = mat->type == IM_DT_FLOAT32 ? GL_FLOAT : GL_UNSIGNED_BYTE;
444-
#if IMGUI_VULKAN_SHADER
445-
if (mat->device == IM_DD_VULKAN)
446-
{
447-
ImGui::VkMat * vkmat = (ImGui::VkMat*)mat;
448-
if (!vkmat->empty())
449-
{
450-
auto data = ImGui::ImVulkanVkMatMapping(*vkmat);
451-
if (data) glTexSubImage2D(GL_TEXTURE_2D, 0, offset_x, offset_y, width, height, fmt, src_format, data);
452-
}
453-
}
454-
else
455-
#endif
444+
//#if IMGUI_VULKAN_SHADER
445+
// if (mat->device == IM_DD_VULKAN)
446+
// {
447+
// ImGui::VkMat * vkmat = (ImGui::VkMat*)mat;
448+
// if (!vkmat->empty())
449+
// {
450+
// auto data = ImGui::ImVulkanVkMatMapping(*vkmat);
451+
// if (data) glTexSubImage2D(GL_TEXTURE_2D, 0, offset_x, offset_y, width, height, fmt, src_format, data);
452+
// }
453+
// }
454+
// else
455+
//#endif
456456
if (mat->device == IM_DD_CPU)
457457
{
458458
glTexSubImage2D(GL_TEXTURE_2D, 0, offset_x, offset_y, width, height, fmt, src_format, mat->data);

imgui/immat.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
// allocating more bytes keeps us safe from SEGV_ACCERR failure
3535
#define IM_MALLOC_OVERREAD 64
3636

37+
#define IM_CSTEP_ALIGN 1
38+
3739
#define OMP_THREADS 2
3840
// exchange-add operation for atomic operations on reference counters
3941
#if defined __riscv && !defined __riscv_atomic
@@ -1179,7 +1181,7 @@ inline ImMat::ImMat(int _w, int _h, void* _data, size_t _elemsize, Allocator* _a
11791181
inline ImMat::ImMat(int _w, int _h, int _c, void* _data, size_t _elemsize, Allocator* _allocator)
11801182
: data(_data), device(IM_DD_CPU), device_number(-1), elemsize(_elemsize), elempack(1), allocator(_allocator), dims(3), w(_w), h(_h), c(_c), dw(_w), dh(_h), time_stamp(NAN), index_count(-1), duration(NAN)
11811183
{
1182-
cstep = Im_AlignSize((size_t)w * h * elemsize, 16) / elemsize;
1184+
cstep = Im_AlignSize((size_t)w * h * elemsize, IM_CSTEP_ALIGN) / elemsize;
11831185
type = _elemsize == 1 ? IM_DT_INT8 : _elemsize == 2 ? IM_DT_INT16 : IM_DT_FLOAT32;
11841186
color_space = IM_CS_SRGB;
11851187
color_format = c == 1 ? IM_CF_GRAY : c == 3 ? IM_CF_BGR : IM_CF_ABGR;
@@ -1221,7 +1223,7 @@ inline ImMat::ImMat(int _w, int _h, void* _data, size_t _elemsize, int _elempack
12211223
inline ImMat::ImMat(int _w, int _h, int _c, void* _data, size_t _elemsize, int _elempack, Allocator* _allocator)
12221224
: data(_data), device(IM_DD_CPU), device_number(-1), elemsize(_elemsize), elempack(_elempack), allocator(_allocator), dims(3), w(_w), h(_h), c(_c), dw(_w), dh(_h), time_stamp(NAN), index_count(-1), duration(NAN)
12231225
{
1224-
cstep = Im_AlignSize((size_t)w * h * elemsize, 16) / elemsize;
1226+
cstep = Im_AlignSize((size_t)w * h * elemsize, IM_CSTEP_ALIGN) / elemsize;
12251227
type = _elemsize == 1 ? IM_DT_INT8 : _elemsize == 2 ? IM_DT_INT16 : IM_DT_FLOAT32;
12261228
color_space = IM_CS_SRGB;
12271229
color_format = c == 1 ? IM_CF_GRAY : c == 3 ? IM_CF_BGR : IM_CF_ABGR;
@@ -1386,7 +1388,7 @@ inline void ImMat::create(int _w, int _h, int _c, size_t _elemsize, Allocator* _
13861388
duration = NAN;
13871389
index_count = -1;
13881390

1389-
cstep = Im_AlignSize((size_t)w * h * elemsize, 16) / elemsize;
1391+
cstep = Im_AlignSize((size_t)w * h * elemsize, IM_CSTEP_ALIGN) / elemsize;
13901392

13911393
if (total() > 0)
13921394
allocate_buffer();
@@ -1485,7 +1487,7 @@ inline void ImMat::create(int _w, int _h, int _c, size_t _elemsize, int _elempac
14851487
duration = NAN;
14861488
index_count = -1;
14871489

1488-
cstep = Im_AlignSize((size_t)w * h * elemsize, 16) / elemsize;
1490+
cstep = Im_AlignSize((size_t)w * h * elemsize, IM_CSTEP_ALIGN) / elemsize;
14891491

14901492
if (total() > 0)
14911493
allocate_buffer();
@@ -1575,7 +1577,7 @@ inline void ImMat::create_type(int _w, int _h, int _c, ImDataType _t, Allocator*
15751577
dh = h = _h;
15761578
c = _c;
15771579

1578-
cstep = Im_AlignSize((size_t)w * h * elemsize, 16) / elemsize;
1580+
cstep = Im_AlignSize((size_t)w * h * elemsize, IM_CSTEP_ALIGN) / elemsize;
15791581
type = _t;
15801582
color_space = IM_CS_SRGB;
15811583
color_format = c == 1 ? IM_CF_GRAY : c == 3 ? IM_CF_BGR : IM_CF_ABGR;
@@ -1676,7 +1678,7 @@ inline void ImMat::create_type(int _w, int _h, int _c, void* _data, ImDataType _
16761678
dh = h = _h;
16771679
c = _c;
16781680

1679-
cstep = Im_AlignSize((size_t)w * h * elemsize, 4) / elemsize;
1681+
cstep = Im_AlignSize((size_t)w * h * elemsize, IM_CSTEP_ALIGN) / elemsize;
16801682
type = _t;
16811683
color_space = IM_CS_SRGB;
16821684
color_format = c == 1 ? IM_CF_GRAY : c == 3 ? IM_CF_BGR : IM_CF_ABGR;

0 commit comments

Comments
 (0)