diff options
author | Nick Sarnie <sarnex@gentoo.org> | 2022-11-05 21:18:58 -0400 |
---|---|---|
committer | Nick Sarnie <sarnex@gentoo.org> | 2022-11-08 18:56:50 -0500 |
commit | d7b90ba00c47603dfc9c431ecfd421deb374b89f (patch) | |
tree | 07a55299f2b76750e1fc5600cfa425d6e8c7691d /media-gfx/renderdoc | |
parent | media-libs/shaderc: add 2022.3 (diff) | |
download | gentoo-d7b90ba00c47603dfc9c431ecfd421deb374b89f.tar.gz gentoo-d7b90ba00c47603dfc9c431ecfd421deb374b89f.tar.bz2 gentoo-d7b90ba00c47603dfc9c431ecfd421deb374b89f.zip |
media-gfx/renderdoc: Update glslang dep
Signed-off-by: Nick Sarnie <sarnex@gentoo.org>
Diffstat (limited to 'media-gfx/renderdoc')
-rw-r--r-- | media-gfx/renderdoc/files/renderdoc-1.22-r1-system-glslang.patch | 215 | ||||
-rw-r--r-- | media-gfx/renderdoc/renderdoc-1.22-r1.ebuild | 203 |
2 files changed, 418 insertions, 0 deletions
diff --git a/media-gfx/renderdoc/files/renderdoc-1.22-r1-system-glslang.patch b/media-gfx/renderdoc/files/renderdoc-1.22-r1-system-glslang.patch new file mode 100644 index 000000000000..7b5b88a53625 --- /dev/null +++ b/media-gfx/renderdoc/files/renderdoc-1.22-r1-system-glslang.patch @@ -0,0 +1,215 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 857c848b9..0423b3e3c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -448,6 +448,17 @@ elseif(UNIX) + endif() + endif() + ++# glslang package does not export a -config.cmake file. ++option(GLSLANG_TARGET_DIR "Absolute path to glslangTargets.cmake directory") ++include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake") ++include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake") ++include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") ++include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake") ++include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake") ++if(NOT TARGET glslang OR NOT TARGET SPIRV) ++ message(FATAL_ERROR "glslang or SPIRV target not found") ++endif() ++ + add_subdirectory(renderdoc) + + # these variables are handled within the CMakeLists.txt in qrenderdoc, +diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt +index a26438d76..9ee043959 100644 +--- a/renderdoc/CMakeLists.txt ++++ b/renderdoc/CMakeLists.txt +@@ -601,7 +601,7 @@ endif() + add_library(renderdoc SHARED ${renderdoc_objects}) + target_compile_definitions(renderdoc ${RDOC_DEFINITIONS}) + target_include_directories(renderdoc ${RDOC_INCLUDES}) +-target_link_libraries(renderdoc ${RDOC_LIBRARIES}) ++target_link_libraries(renderdoc ${RDOC_LIBRARIES} glslang SPIRV) + + add_dependencies(renderdoc renderdoc_libentry) + +diff --git a/renderdoc/data/glsl_shaders.cpp b/renderdoc/data/glsl_shaders.cpp +index dd79c1f89..5295fb05e 100644 +--- a/renderdoc/data/glsl_shaders.cpp ++++ b/renderdoc/data/glsl_shaders.cpp +@@ -26,7 +26,7 @@ + #include "common/common.h" + #include "common/formatting.h" + #include "driver/shaders/spirv/glslang_compile.h" +-#include "glslang/glslang/Public/ShaderLang.h" ++#include <glslang/Public/ShaderLang.h> + #include "os/os_specific.h" + + #define GLSL_HEADERS(HEADER) \ +diff --git a/renderdoc/driver/gl/gl_shader_refl.cpp b/renderdoc/driver/gl/gl_shader_refl.cpp +index dfd871f32..57b5aeca6 100644 +--- a/renderdoc/driver/gl/gl_shader_refl.cpp ++++ b/renderdoc/driver/gl/gl_shader_refl.cpp +@@ -26,7 +26,7 @@ + #include <algorithm> + #include <functional> + #include "driver/shaders/spirv/glslang_compile.h" +-#include "glslang/glslang/Public/ShaderLang.h" ++#include <glslang/Public/ShaderLang.h> + #include "gl_driver.h" + + template <> +diff --git a/renderdoc/driver/shaders/spirv/CMakeLists.txt b/renderdoc/driver/shaders/spirv/CMakeLists.txt +index e5f2f4113..79525b5f6 100644 +--- a/renderdoc/driver/shaders/spirv/CMakeLists.txt ++++ b/renderdoc/driver/shaders/spirv/CMakeLists.txt +@@ -1,91 +1,3 @@ +-set(glslang_dir ${RDOC_SOURCE_DIR}/3rdparty/glslang) +-set(glslang_sources +- ${glslang_dir}/OGLCompilersDLL/InitializeDll.cpp +- ${glslang_dir}/OGLCompilersDLL/InitializeDll.h +- ${glslang_dir}/SPIRV/GlslangToSpv.cpp +- ${glslang_dir}/SPIRV/GlslangToSpv.h +- ${glslang_dir}/SPIRV/GLSL.std.450.h +- ${glslang_dir}/SPIRV/GLSL.ext.AMD.h +- ${glslang_dir}/SPIRV/GLSL.ext.EXT.h +- ${glslang_dir}/SPIRV/GLSL.ext.KHR.h +- ${glslang_dir}/SPIRV/GLSL.ext.NV.h +- ${glslang_dir}/SPIRV/hex_float.h +- ${glslang_dir}/SPIRV/InReadableOrder.cpp +- ${glslang_dir}/SPIRV/Logger.cpp +- ${glslang_dir}/SPIRV/Logger.h +- ${glslang_dir}/SPIRV/SpvBuilder.cpp +- ${glslang_dir}/SPIRV/SpvBuilder.h +- ${glslang_dir}/SPIRV/SpvTools.cpp +- ${glslang_dir}/SPIRV/SpvTools.h +- ${glslang_dir}/SPIRV/SpvPostProcess.cpp +- ${glslang_dir}/SPIRV/spvIR.h +- ${glslang_dir}/glslang/GenericCodeGen/CodeGen.cpp +- ${glslang_dir}/glslang/GenericCodeGen/Link.cpp +- ${glslang_dir}/glslang/Include/arrays.h +- ${glslang_dir}/glslang/Include/BaseTypes.h +- ${glslang_dir}/glslang/Include/Common.h +- ${glslang_dir}/glslang/Include/ConstantUnion.h +- ${glslang_dir}/glslang/Include/InfoSink.h +- ${glslang_dir}/glslang/Include/InitializeGlobals.h +- ${glslang_dir}/glslang/Include/intermediate.h +- ${glslang_dir}/glslang/Include/PoolAlloc.h +- ${glslang_dir}/glslang/Include/ResourceLimits.h +- ${glslang_dir}/glslang/Include/revision.h +- ${glslang_dir}/glslang/Include/ShHandle.h +- ${glslang_dir}/glslang/Include/Types.h +- ${glslang_dir}/glslang/MachineIndependent/Constant.cpp +- ${glslang_dir}/glslang/MachineIndependent/glslang_tab.cpp +- ${glslang_dir}/glslang/MachineIndependent/glslang_tab.cpp.h +- ${glslang_dir}/glslang/MachineIndependent/gl_types.h +- ${glslang_dir}/glslang/MachineIndependent/iomapper.cpp +- ${glslang_dir}/glslang/MachineIndependent/iomapper.h +- ${glslang_dir}/glslang/MachineIndependent/gl_types.h +- ${glslang_dir}/glslang/MachineIndependent/InfoSink.cpp +- ${glslang_dir}/glslang/MachineIndependent/Initialize.cpp +- ${glslang_dir}/glslang/MachineIndependent/Initialize.h +- ${glslang_dir}/glslang/MachineIndependent/Intermediate.cpp +- ${glslang_dir}/glslang/MachineIndependent/intermOut.cpp +- ${glslang_dir}/glslang/MachineIndependent/IntermTraverse.cpp +- ${glslang_dir}/glslang/MachineIndependent/limits.cpp +- ${glslang_dir}/glslang/MachineIndependent/linkValidate.cpp +- ${glslang_dir}/glslang/MachineIndependent/LiveTraverser.h +- ${glslang_dir}/glslang/MachineIndependent/localintermediate.h +- ${glslang_dir}/glslang/MachineIndependent/parseConst.cpp +- ${glslang_dir}/glslang/MachineIndependent/ParseContextBase.cpp +- ${glslang_dir}/glslang/MachineIndependent/ParseHelper.cpp +- ${glslang_dir}/glslang/MachineIndependent/ParseHelper.h +- ${glslang_dir}/glslang/MachineIndependent/PoolAlloc.cpp +- ${glslang_dir}/glslang/MachineIndependent/propagateNoContraction.cpp +- ${glslang_dir}/glslang/MachineIndependent/propagateNoContraction.h +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpAtom.cpp +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpContext.cpp +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpContext.h +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/Pp.cpp +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpScanner.cpp +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpTokens.cpp +- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpTokens.h +- ${glslang_dir}/glslang/MachineIndependent/reflection.cpp +- ${glslang_dir}/glslang/MachineIndependent/reflection.h +- ${glslang_dir}/glslang/MachineIndependent/RemoveTree.cpp +- ${glslang_dir}/glslang/MachineIndependent/RemoveTree.h +- ${glslang_dir}/glslang/MachineIndependent/ScanContext.h +- ${glslang_dir}/glslang/MachineIndependent/Scan.cpp +- ${glslang_dir}/glslang/MachineIndependent/Scan.h +- ${glslang_dir}/glslang/MachineIndependent/ShaderLang.cpp +- ${glslang_dir}/glslang/MachineIndependent/SymbolTable.cpp +- ${glslang_dir}/glslang/MachineIndependent/SymbolTable.h +- ${glslang_dir}/glslang/MachineIndependent/Versions.cpp +- ${glslang_dir}/glslang/MachineIndependent/Versions.h +- ${glslang_dir}/glslang/MachineIndependent/attribute.cpp +- ${glslang_dir}/glslang/MachineIndependent/attribute.h +- ${glslang_dir}/glslang/OSDependent/osinclude.h +- ${glslang_dir}/glslang/Public/ShaderLang.h) +- +-if(UNIX) +- list(APPEND glslang_sources +- ${glslang_dir}/glslang/OSDependent/Unix/ossource.cpp) +-endif() +- + set(sources + glslang_compile.cpp + glslang_compile.h +@@ -108,8 +20,7 @@ set(sources + spirv_processor.h + spirv_disassemble.cpp + spirv_stringise.cpp +- var_dispatch_helpers.h +- ${glslang_sources}) ++ var_dispatch_helpers.h) + + add_definitions(-DAMD_EXTENSIONS) + add_definitions(-DNV_EXTENSIONS) +diff --git a/renderdoc/driver/shaders/spirv/glslang_compile.cpp b/renderdoc/driver/shaders/spirv/glslang_compile.cpp +index e2f1f2df8..fc0adab99 100644 +--- a/renderdoc/driver/shaders/spirv/glslang_compile.cpp ++++ b/renderdoc/driver/shaders/spirv/glslang_compile.cpp +@@ -29,8 +29,8 @@ + #undef min + #undef max + +-#include "glslang/glslang/Include/Types.h" +-#include "glslang/glslang/Public/ShaderLang.h" ++#include <glslang/Include/Types.h> ++#include <glslang/Public/ShaderLang.h> + + static bool glslang_inited = false; + rdcarray<glslang::TShader *> *allocatedShaders = NULL; +@@ -129,7 +129,16 @@ static TBuiltInResource DefaultResources = { + /*.maxTaskWorkGroupSizeY_NV =*/1, + /*.maxTaskWorkGroupSizeZ_NV =*/1, + /*.maxMeshViewCountNV =*/4, +- ++ /*.maxMeshOutputVerticesEXT = */ 256, ++ /*.maxMeshOutputPrimitivesEXT = */ 256, ++ /*.maxMeshWorkGroupSizeX_EXT = */ 128, ++ /*.maxMeshWorkGroupSizeY_EXT = */ 128, ++ /*.maxMeshWorkGroupSizeZ_EXT = */ 128, ++ /*.maxTaskWorkGroupSizeX_EXT = */ 128, ++ /*.maxTaskWorkGroupSizeY_EXT = */ 128, ++ /*.maxTaskWorkGroupSizeZ_EXT = */ 128, ++ /*.maxMeshViewCountEXT = */ 4, ++ /*.maxDualSourceDrawBuffersEXT =*/1, + /*.limits*/ + { + /*.limits.nonInductiveForLoops =*/1, +diff --git a/renderdoc/driver/shaders/spirv/spirv_compile.cpp b/renderdoc/driver/shaders/spirv/spirv_compile.cpp +index 8fbf2f16a..49bd322f4 100644 +--- a/renderdoc/driver/shaders/spirv/spirv_compile.cpp ++++ b/renderdoc/driver/shaders/spirv/spirv_compile.cpp +@@ -31,8 +31,8 @@ + #undef min + #undef max + +-#include "glslang/SPIRV/GlslangToSpv.h" +-#include "glslang/glslang/Public/ShaderLang.h" ++#include <glslang/SPIRV/GlslangToSpv.h> ++#include <glslang/Public/ShaderLang.h> + + rdcstr rdcspv::Compile(const rdcspv::CompilationSettings &settings, const rdcarray<rdcstr> &sources, + rdcarray<uint32_t> &spirv) diff --git a/media-gfx/renderdoc/renderdoc-1.22-r1.ebuild b/media-gfx/renderdoc/renderdoc-1.22-r1.ebuild new file mode 100644 index 000000000000..a7491c866ecf --- /dev/null +++ b/media-gfx/renderdoc/renderdoc-1.22-r1.ebuild @@ -0,0 +1,203 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# The swig fork is required for compatibility with both provided and +# 3rd-party Python scripts. Required patch was sent to upstream in +# 2014: https://github.com/swig/swig/pull/251 +MY_SWIG_VER=7 +MY_SWIG=swig-${PN}-${MY_SWIG_VER} + +AUTOTOOLS_AUTO_DEPEND="no" +DOCS_BUILDER="sphinx" +DOCS_DIR="docs" +# For Python 3.11, see https://github.com/baldurk/renderdoc/issues/2730 +PYTHON_COMPAT=( python3_{9,10} ) +inherit autotools cmake flag-o-matic optfeature python-single-r1 docs qmake-utils verify-sig xdg + +DESCRIPTION="A stand-alone graphics debugging tool" +HOMEPAGE="https://renderdoc.org https://github.com/baldurk/renderdoc" +SRC_URI=" + https://github.com/baldurk/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + qt5? ( https://github.com/baldurk/swig/archive/${PN}-modified-${MY_SWIG_VER}.tar.gz -> ${MY_SWIG}.tar.gz ) + verify-sig? ( https://github.com/baldurk/renderdoc/releases/download/v${PV}/v${PV}.tar.gz.asc -> ${P}.tar.gz.asc ) +" + +# renderdoc: MIT +# + cmdline: BSD (not compatible with upstream lib) +# + farm fresh icons: CC-BY-3.0 +# + half: MIT (not compatible with system dev-libs/half) +# + include-bin ZLIB (upstream doesn't exist anymore, maintained in tree) +# + md5: public-domain +# + plthook: BSD-2 +# + pugixml: MIT +# + radeon gpu analyzer: MIT +# + source code pro: OFL-1.1 +# + stb: public-domain +# + tinyfiledialogs: ZLIB +# + docs? ( sphinx.paramlinks: MIT ) +# swig: GPL-3+ BSD BSD-2 +LICENSE="BSD BSD-2 CC-BY-3.0 GPL-3+ MIT OFL-1.1 public-domain ZLIB" +SLOT="0" +KEYWORDS="~amd64" +IUSE="pyside2 qt5" +REQUIRED_USE="doc? ( qt5 ) pyside2? ( qt5 ) qt5? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + app-arch/lz4:= + app-arch/zstd:= + dev-libs/miniz:= + >=dev-util/glslang-1.3.231:= + x11-libs/libX11 + x11-libs/libxcb:= + x11-libs/xcb-util-keysyms + virtual/opengl + pyside2? ( + $(python_gen_cond_dep ' + dev-python/pyside2[${PYTHON_USEDEP}] + ') + ) + qt5? ( + ${PYTHON_DEPS} + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtnetwork:5[ssl] + dev-qt/qtsvg:5 + dev-qt/qtwidgets:5 + dev-qt/qtx11extras:5 + ) +" +DEPEND="${RDEPEND}" +# qtcore provides qmake, which is required to build the qrenderdoc gui. +BDEPEND=" + x11-base/xorg-proto + virtual/pkgconfig + qt5? ( + ${AUTOTOOLS_DEPEND} + ${PYTHON_DEPS} + dev-libs/libpcre + dev-qt/qtcore:5 + sys-devel/bison + ) + verify-sig? ( sec-keys/openpgp-keys-baldurkarlsson ) +" + +PATCHES=( + # The analytics seem very reasonable, and even without this patch + # they are NOT sent before the user accepts. But default the + # selection to off, just in case. + "${FILESDIR}"/${PN}-1.18-analytics-off.patch + + # Only search for PySide2 if pyside2 USE flag is set. + # Bug #833627 + "${FILESDIR}"/${PN}-1.18-conditional-pyside.patch + + # Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is + # built. + "${FILESDIR}"/${PN}-1.18-system-flags.patch + + # Needed to prevent sandbox violations during build. + "${FILESDIR}"/${PN}-1.18-env-home.patch + + "${FILESDIR}"/${PN}-1.22-r1-system-glslang.patch + "${FILESDIR}"/${PN}-1.18-system-compress.patch +) + +DOCS=( util/LINUX_DIST_README ) + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/baldurkarlsson.gpg + +pkg_setup() { + use qt5 && python-single-r1_pkg_setup +} + +src_unpack() { + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc} + fi + + # Do not unpack the swig sources here. CMake will do that if + # required. + unpack ${P}.tar.gz +} + +src_prepare() { + cmake_src_prepare + + # Ensure that we use the system glslang headers instead of the + # vendored copy. + rm -r renderdoc/3rdparty/glslang || die 'rm vendored glslang failed' + + # Remove the calls to install the documentation files. Instead, + # install them with einstalldocs. + sed -i '/share\/doc\/renderdoc/d' \ + "${S}"/CMakeLists.txt "${S}"/qrenderdoc/CMakeLists.txt \ + || die 'sed remove doc install failed' + + # Assumes that the build directory is "${S}"/build, which it is not. + sed -i "s|../build/lib|${BUILD_DIR}/lib|" \ + "${S}"/docs/conf.py \ + || die 'sed patch doc sys.path failed' + + # Bug #836235 + sed -i '/#include <stdarg/i #include <time.h>' \ + "${S}"/renderdoc/os/os_specific.h \ + || die 'sed include time.h failed' +} + +src_configure() { + local mycmakeargs=( + # Build system does not know that this is a tagged release, as + # we just have the tarball and not the git repository. + -DBUILD_VERSION_STABLE=ON + + -DENABLE_EGL=ON + -DENABLE_GL=ON + -DENABLE_GLES=ON + -DENABLE_PYRENDERDOC=$(usex qt5) + -DENABLE_QRENDERDOC=$(usex qt5) + -DENABLE_VULKAN=ON + + # Upstream says that this option is unsupported and should not + # be used yet. + -DENABLE_WAYLAND=OFF + + -DENABLE_XCB=ON + -DENABLE_XLIB=ON + + # Path to glslang*.cmake. + -DGLSLANG_TARGET_DIR="${ESYSROOT}"/usr/$(get_libdir)/cmake + + # renderdoc_capture.json is installed here + -DVULKAN_LAYER_FOLDER="${EPREFIX}"/etc/vulkan/implicit_layer.d + ) + + use qt5 && mycmakeargs+=( + -DPython3_EXECUTABLE="${PYTHON}" + -DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz + + # Needed after qtchooser removal, bug #836474. + -DQMAKE_QT5_COMMAND="$(qt5_get_bindir)"/qmake + + -DQRENDERDOC_ENABLE_PYSIDE2=$(usex pyside2) + ) + + use pyside2 && mycmakeargs+=( -DPYTHON_CONFIG_SUFFIX=-${EPYTHON} ) + + # Lots of type mismatch issues. + filter-lto + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + docs_compile +} + +pkg_postinst() { + xdg_pkg_postinst + optfeature "android remote contexts" dev-util/android-tools + optfeature "vulkan contexts" media-libs/vulkan-loader +} |