renderdoc-1.30-r1-system-compress.patch (4565B)
1 From 8f16c974fc8ec0b286d803490baa6e00a83615cf Mon Sep 17 00:00:00 2001 2 From: Matthew Smith <matt@offtopica.uk> 3 Date: Sun, 30 Jan 2022 18:07:51 +0000 4 Subject: [PATCH 2/3] build: Use system compression libs 5 6 --- 7 CMakeLists.txt | 6 +++ 8 renderdoc/CMakeLists.txt | 48 +------------------ 9 renderdoc/core/replay_proxy.cpp | 2 +- 10 .../driver/shaders/dxbc/dxbc_container.cpp | 2 +- 11 renderdoc/serialise/lz4io.h | 2 +- 12 5 files changed, 10 insertions(+), 50 deletions(-) 13 14 diff --git a/CMakeLists.txt b/CMakeLists.txt 15 index cb0a2c7f6..0ee4fc629 100644 16 --- a/CMakeLists.txt 17 +++ b/CMakeLists.txt 18 @@ -473,6 +473,12 @@ 19 endif() 20 endif() 21 22 +find_package(PkgConfig REQUIRED) 23 +find_package(miniz REQUIRED CONFIG) 24 + 25 +pkg_check_modules(lz4 REQUIRED IMPORTED_TARGET liblz4) 26 +pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd) 27 + 28 add_subdirectory(renderdoc) 29 30 # these variables are handled within the CMakeLists.txt in qrenderdoc, 31 diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt 32 index 927e95fb9..5908be6de 100644 33 --- a/renderdoc/CMakeLists.txt 34 +++ b/renderdoc/CMakeLists.txt 35 @@ -218,56 +218,10 @@ set(sources 36 3rdparty/pugixml/pugixml.cpp 37 3rdparty/pugixml/pugixml.hpp 38 3rdparty/pugixml/pugiconfig.hpp 39 - 3rdparty/lz4/lz4.c 40 - 3rdparty/lz4/lz4.h 41 3rdparty/md5/md5.c 42 3rdparty/md5/md5.h 43 - 3rdparty/miniz/miniz.c 44 - 3rdparty/miniz/miniz.h 45 3rdparty/superluminal/superluminal.cpp 46 3rdparty/superluminal/superluminal.h 47 - 3rdparty/zstd/bitstream.h 48 - 3rdparty/zstd/compiler.h 49 - 3rdparty/zstd/cpu.h 50 - 3rdparty/zstd/debug.c 51 - 3rdparty/zstd/debug.h 52 - 3rdparty/zstd/entropy_common.c 53 - 3rdparty/zstd/error_private.c 54 - 3rdparty/zstd/error_private.h 55 - 3rdparty/zstd/fse.h 56 - 3rdparty/zstd/fse_compress.c 57 - 3rdparty/zstd/fse_decompress.c 58 - 3rdparty/zstd/hist.c 59 - 3rdparty/zstd/hist.h 60 - 3rdparty/zstd/huf.h 61 - 3rdparty/zstd/huf_compress.c 62 - 3rdparty/zstd/huf_decompress.c 63 - 3rdparty/zstd/mem.h 64 - 3rdparty/zstd/pool.c 65 - 3rdparty/zstd/pool.h 66 - 3rdparty/zstd/threading.c 67 - 3rdparty/zstd/threading.h 68 - 3rdparty/zstd/xxhash.c 69 - 3rdparty/zstd/xxhash.h 70 - 3rdparty/zstd/zstd.h 71 - 3rdparty/zstd/zstd_common.c 72 - 3rdparty/zstd/zstd_compress.c 73 - 3rdparty/zstd/zstd_compress_internal.h 74 - 3rdparty/zstd/zstd_decompress.c 75 - 3rdparty/zstd/zstd_double_fast.c 76 - 3rdparty/zstd/zstd_double_fast.h 77 - 3rdparty/zstd/zstd_errors.h 78 - 3rdparty/zstd/zstd_fast.c 79 - 3rdparty/zstd/zstd_fast.h 80 - 3rdparty/zstd/zstd_internal.h 81 - 3rdparty/zstd/zstd_lazy.c 82 - 3rdparty/zstd/zstd_lazy.h 83 - 3rdparty/zstd/zstd_ldm.c 84 - 3rdparty/zstd/zstd_ldm.h 85 - 3rdparty/zstd/zstd_opt.c 86 - 3rdparty/zstd/zstd_opt.h 87 - 3rdparty/zstd/zstdmt_compress.c 88 - 3rdparty/zstd/zstdmt_compress.h 89 3rdparty/stb/stb_image.h 90 3rdparty/stb/stb_image_write.h 91 3rdparty/stb/stb_image_resize.h 92 @@ -580,7 +534,7 @@ endif() 93 add_library(renderdoc SHARED ${renderdoc_objects}) 94 target_compile_definitions(renderdoc ${RDOC_DEFINITIONS}) 95 target_include_directories(renderdoc ${RDOC_INCLUDES}) 96 -target_link_libraries(renderdoc ${RDOC_LIBRARIES}) 97 +target_link_libraries(renderdoc ${RDOC_LIBRARIES} miniz::miniz PkgConfig::lz4 PkgConfig::zstd) 98 99 add_dependencies(renderdoc renderdoc_libentry) 100 101 diff --git a/renderdoc/core/replay_proxy.cpp b/renderdoc/core/replay_proxy.cpp 102 index dea1e86cf..c9362e797 100644 103 --- a/renderdoc/core/replay_proxy.cpp 104 +++ b/renderdoc/core/replay_proxy.cpp 105 @@ -25,7 +25,7 @@ 106 107 #include "replay_proxy.h" 108 #include <list> 109 -#include "lz4/lz4.h" 110 +#include <lz4.h> 111 #include "replay/dummy_driver.h" 112 #include "serialise/lz4io.h" 113 114 diff --git a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp 115 index ede1fdeb7..0c8fd4dfe 100644 116 --- a/renderdoc/driver/shaders/dxbc/dxbc_container.cpp 117 +++ b/renderdoc/driver/shaders/dxbc/dxbc_container.cpp 118 @@ -29,7 +29,7 @@ 119 #include "common/common.h" 120 #include "core/settings.h" 121 #include "driver/shaders/dxil/dxil_bytecode.h" 122 -#include "lz4/lz4.h" 123 +#include <lz4.h> 124 #include "md5/md5.h" 125 #include "serialise/serialiser.h" 126 #include "strings/string_utils.h" 127 diff --git a/renderdoc/serialise/lz4io.h b/renderdoc/serialise/lz4io.h 128 index 199fbbbc1..80fdf94f2 100644 129 --- a/renderdoc/serialise/lz4io.h 130 +++ b/renderdoc/serialise/lz4io.h 131 @@ -24,7 +24,7 @@ 132 133 #pragma once 134 135 -#include "lz4/lz4.h" 136 +#include <lz4.h> 137 #include "streamio.h" 138 139 class LZ4Compressor : public Compressor 140 -- 141 2.35.1 142