Skip to content

Commit

Permalink
renderdoc: update to 1.21.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgn committed Sep 24, 2022
1 parent 9e8a442 commit 4e19a50
Show file tree
Hide file tree
Showing 14 changed files with 258 additions and 49 deletions.
8 changes: 2 additions & 6 deletions srcpkgs/renderdoc/patches/add-x86-family.patch
Expand Up @@ -14,13 +14,11 @@ Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
renderdoc/common/globalconfig.h | 10 ++++++++++
2 files changed, 18 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ee30d4..d2edf3d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,6 +89,14 @@ set(RENDERDOC_APK_PATH "" CACHE STRING "Path to RenderDoc .apk files after insta
set(LIB_SUFFIX "" CACHE STRING "Suffix for 'lib' folder in target directory structure. E.g. set to '64' to use /usr/local/lib64 instead of /usr/local/lib.")
@@ -98,6 +98,14 @@ set(LIB_SUFFIX "" CACHE STRING "Suffix f
set(LIB_SUBFOLDER "" CACHE STRING "Subfolder under the 'lib' folder in target directory structure. E.g. set to 'renderdoc' to use /usr/local/lib/renderdoc instead of /usr/local/lib.")
set(VULKAN_JSON_SUFFIX "" CACHE STRING "Suffix for the vulkan implicit_layer json file. E.g. set to '.x86_64' to use renderdoc_capture.x86_64.json instead of renderdoc_capture.json")

+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
+ CMAKE_SYSTEM_PROCESSOR MATCHES "i686")
Expand All @@ -33,8 +31,6 @@ index 7ee30d4..d2edf3d 100644
if(NOT LIB_SUFFIX STREQUAL "")
add_definitions(-DRENDERDOC_LIB_SUFFIX=${LIB_SUFFIX})
endif()
diff --git a/renderdoc/common/globalconfig.h b/renderdoc/common/globalconfig.h
index d266166..d21da15 100644
--- a/renderdoc/common/globalconfig.h
+++ b/renderdoc/common/globalconfig.h
@@ -125,6 +125,16 @@
Expand Down
4 changes: 2 additions & 2 deletions srcpkgs/renderdoc/patches/atomic.patch
Expand Up @@ -3,11 +3,11 @@ so we can use libatomic on targets without atomic8 support

--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -55,6 +55,10 @@ elseif(UNIX)
@@ -59,6 +59,10 @@ elseif(UNIX)
PRIVATE -ldl
PRIVATE -lrt)

+option(NEED_LIBATOMIC "need libatomic" OFF)
+option(NEED_LIBATOMIC "need libatomic" OFF)
+if (NEED_LIBATOMIC)
+list(APPEND RDOC_LIBRARIES PRIVATE -latomic)
+endif()
Expand Down
14 changes: 14 additions & 0 deletions srcpkgs/renderdoc/patches/backtrace.patch
@@ -0,0 +1,14 @@
--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -54,6 +54,11 @@ elseif(UNIX)
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)

+ option(NEED_LIBEXECINFO "need libexecinfo" OFF)
+ if (NEED_LIBEXECINFO)
+ list(APPEND RDOC_LIBRARIES PRIVATE -lexecinfo)
+ endif()
+
list(APPEND RDOC_LIBRARIES
PRIVATE -lm
PRIVATE -ldl
6 changes: 2 additions & 4 deletions srcpkgs/renderdoc/patches/build-type-none-is-release.patch
@@ -1,12 +1,10 @@
Index: CMakeLists.txt
===================================================================
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -315,6 +315,7 @@ set(RELEASE_MODE 0)
@@ -346,6 +346,7 @@ set(RELEASE_MODE 0)

if(cmake_build_type_lower STREQUAL "release" OR
cmake_build_type_lower STREQUAL "relwithdebinfo" OR
+ cmake_build_type_lower STREQUAL "none" OR
cmake_build_type_lower STREQUAL "minsizerel")
add_definitions(-D_RELEASE)
add_definitions(-DRELEASE)
message(STATUS "Building RenderDoc in Release mode: ${CMAKE_BUILD_TYPE}")
8 changes: 3 additions & 5 deletions srcpkgs/renderdoc/patches/c++14-needed.patch
@@ -1,8 +1,6 @@
Index: renderdoc-1.12/CMakeLists.txt
===================================================================
--- renderdoc-1.12.orig/CMakeLists.txt
+++ renderdoc-1.12/CMakeLists.txt
@@ -323,7 +323,7 @@ if(cmake_build_type_lower STREQUAL "rele
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -371,7 +371,7 @@ if(STRIP_ANDROID_LIBRARY AND BUILD_ANDRO
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
8 changes: 2 additions & 6 deletions srcpkgs/renderdoc/patches/compressonator-only-x86.patch
Expand Up @@ -8,11 +8,9 @@ Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
renderdoc/replay/replay_driver.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt
index e3e8c28..59c8937 100644
--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -342,7 +342,7 @@ elseif(UNIX)
@@ -355,7 +355,7 @@ elseif(UNIX)
os/posix/posix_specific.h)
endif()

Expand All @@ -21,11 +19,9 @@ index e3e8c28..59c8937 100644
list(APPEND sources
3rdparty/compressonator/BC1_Encode_kernel.cpp
3rdparty/compressonator/BC2_Encode_kernel.cpp
diff --git a/renderdoc/replay/replay_driver.cpp b/renderdoc/replay/replay_driver.cpp
index a704726..7f3387f 100644
--- a/renderdoc/replay/replay_driver.cpp
+++ b/renderdoc/replay/replay_driver.cpp
@@ -1430,8 +1430,8 @@ bytebuf GetDiscardPattern(DiscardType type, const ResourceFormat &fmt, uint32_t
@@ -1647,8 +1647,8 @@ bytebuf GetDiscardPattern(DiscardType ty
fmt.type == ResourceFormatType::BC5 || fmt.type == ResourceFormatType::BC6 ||
fmt.type == ResourceFormatType::BC7)
{
Expand Down
4 changes: 1 addition & 3 deletions srcpkgs/renderdoc/patches/dostringise.patch
Expand Up @@ -12,11 +12,9 @@ Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
renderdoc/serialise/serialiser.cpp | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/renderdoc/serialise/serialiser.cpp b/renderdoc/serialise/serialiser.cpp
index 460a310..9e53fb1 100644
--- a/renderdoc/serialise/serialiser.cpp
+++ b/renderdoc/serialise/serialiser.cpp
@@ -937,6 +937,14 @@ rdcstr DoStringise(const int16_t &el)
@@ -985,6 +985,14 @@ rdcstr DoStringise(const int16_t &el)
return StringFormat::Fmt("%hd", el);
}

Expand Down
98 changes: 98 additions & 0 deletions srcpkgs/renderdoc/patches/musl.patch
@@ -0,0 +1,98 @@
--- a/renderdoc/os/posix/linux/linux_hook.cpp
+++ b/renderdoc/os/posix/linux/linux_hook.cpp
@@ -70,8 +70,10 @@ __attribute__((visibility("default"))) v

void *ret = passthru(filename, flag);

+#ifdef __GLIBC__
if(filename && ret && (flag & RTLD_DEEPBIND))
plthook_lib(ret);
+#endif

return ret;
}
@@ -506,8 +508,10 @@ void *intercept_dlopen(const char *filen
if(filename == NULL)
return ret;

+#ifdef __GLIBC__
if(flag & RTLD_DEEPBIND)
plthook_lib(ret);
+#endif

rdcstr base = get_basename(filename);

--- a/renderdoc/3rdparty/plthook/plthook_elf.c
+++ b/renderdoc/3rdparty/plthook/plthook_elf.c
@@ -62,7 +62,7 @@
#include <link.h>
#include "plthook.h"

-#if defined __UCLIBC__ && !defined RTLD_NOLOAD
+#if !defined(__GLIBC__) && !defined(RTLD_NOLOAD)
#define RTLD_NOLOAD 0
#endif

@@ -204,7 +204,7 @@ static int check_elf_header(const Elf_Eh
#endif
static void set_errmsg(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2)));

-#if defined __ANDROID__ || defined __UCLIBC__
+#if defined(__linux__) && !defined(__GLIBC__)
struct dl_iterate_data {
char* addr;
struct link_map lmap;
@@ -249,7 +249,7 @@ int plthook_open(plthook_t **plthook_out

int plthook_open_by_handle(plthook_t **plthook_out, void *hndl)
{
-#if defined __ANDROID__ || defined __UCLIBC__
+#if defined (__linux__) && !defined(__GLIBC__)
const static char *symbols[] = {
"__INIT_ARRAY__",
"_end",
@@ -288,7 +288,7 @@ int plthook_open_by_address(plthook_t **
{
#if defined __FreeBSD__
return PLTHOOK_NOT_IMPLEMENTED;
-#elif defined __ANDROID__ || defined __UCLIBC__
+#elif defined(__linux__) && !defined(__GLIBC__)
struct dl_iterate_data data = {0,};
data.addr = address;
dl_iterate_phdr(dl_iterate_cb, &data);
@@ -312,7 +312,7 @@ int plthook_open_by_address(plthook_t **

static int plthook_open_executable(plthook_t **plthook_out)
{
-#if defined __ANDROID__ || defined __UCLIBC__
+#if defined(__linux__) && !defined(__GLIBC__)
return plthook_open_shared_library(plthook_out, NULL);
#elif defined __linux__
return plthook_open_real(plthook_out, _r_debug.r_map);
@@ -351,7 +351,7 @@ static int plthook_open_executable(pltho
static int plthook_open_shared_library(plthook_t **plthook_out, const char *filename)
{
void *hndl = dlopen(filename, RTLD_LAZY | RTLD_NOLOAD);
-#if defined __ANDROID__ || defined __UCLIBC__
+#if defined(__linux__) && !defined(__GLIBC__)
int rv;
#else
struct link_map *lmap = NULL;
@@ -361,7 +361,7 @@ static int plthook_open_shared_library(p
set_errmsg("dlopen error: %s", dlerror());
return PLTHOOK_FILE_NOT_FOUND;
}
-#if defined __ANDROID__ || defined __UCLIBC__
+#if defined(__linux__) && !defined(__GLIBC__)
rv = plthook_open_by_handle(plthook_out, hndl);
dlclose(hndl);
return rv;
@@ -553,7 +553,7 @@ static int plthook_open_real(plthook_t *

#if defined __linux__
plthook.plt_addr_base = (char*)lmap->l_addr;
-#if defined __ANDROID__ || defined __UCLIBC__
+#if !defined(__GLIBC__)
dyn_addr_base = (const char*)lmap->l_addr;
#endif
#elif defined __FreeBSD__ || defined __sun
8 changes: 3 additions & 5 deletions srcpkgs/renderdoc/patches/ptrace-only-x86.patch
Expand Up @@ -14,11 +14,9 @@ Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
renderdoc/os/posix/linux/linux_process.cpp | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/renderdoc/os/posix/linux/linux_process.cpp b/renderdoc/os/posix/linux/linux_process.cpp
index 7db273f..491268d 100644
--- a/renderdoc/os/posix/linux/linux_process.cpp
+++ b/renderdoc/os/posix/linux/linux_process.cpp
@@ -50,6 +50,8 @@ extern char **environ;
@@ -55,6 +55,8 @@ extern char **environ;
#define INITIAL_WAIT_TIME 1
#define MAX_WAIT_TIME 0xfffff

Expand All @@ -27,7 +25,7 @@ index 7db273f..491268d 100644
char **GetCurrentEnvironment()
{
return environ;
@@ -150,6 +152,8 @@ int GetIdentPort(pid_t childPid)
@@ -155,6 +157,8 @@ int GetIdentPort(pid_t childPid)
return ret;
}

Expand All @@ -36,7 +34,7 @@ index 7db273f..491268d 100644
static bool ptrace_scope_ok()
{
if(!Linux_PtraceChildProcesses())
@@ -577,6 +581,23 @@ void ResumeProcess(pid_t childPid, uint32_t delaySeconds)
@@ -617,6 +621,23 @@ void ResumeProcess(pid_t childPid, uint3
}
}

Expand Down
85 changes: 85 additions & 0 deletions srcpkgs/renderdoc/patches/python-3.11.patch
@@ -0,0 +1,85 @@
--- a/qrenderdoc/Code/pyrenderdoc/function_conversion.h
+++ b/qrenderdoc/Code/pyrenderdoc/function_conversion.h
@@ -303,11 +303,19 @@ funcType ConvertFunc(const char *funcnam

while(frame)
{
+#if PY_VERSION_HEX >= 0x030B0000
+ global_internal_handle = PyDict_GetItemString(PyFrame_GetGlobals(frame), "_renderdoc_internal");
+#else
global_internal_handle = PyDict_GetItemString(frame->f_globals, "_renderdoc_internal");
+#endif

if(global_internal_handle)
break;
+#if PY_VERSION_HEX >= 0x03090000
+ frame = PyFrame_GetBack(frame);
+#else
frame = frame->f_back;
+#endif
}
}

--- a/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp
+++ b/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp
@@ -85,6 +85,15 @@ extern "C" PyObject *PyInit_qrenderdoc(v
extern "C" PyObject *WrapBareQWidget(QWidget *);
extern "C" QWidget *UnwrapBareQWidget(PyObject *);

+#if PY_VERSION_HEX <=0x030B0000
+#define PyFrame_GetGlobals(x) (x)->f_globals
+#endif
+
+#if PY_VERSION_HEX <=0x03090000
+#define PyFrame_GetBack(x) (x)->f_back
+#define PyFrame_GetCode(x) (x)->f_code
+#endif
+
// little utility function to convert a PyObject * that we know is a string to a QString
static inline QString ToQStr(PyObject *value)
{
@@ -1213,7 +1222,7 @@ PyObject *PythonContext::outstream_write

while(frame)
{
- PyObject *globals = frame->f_globals;
+ PyObject *globals = PyFrame_GetGlobals(frame);
if(globals)
{
OutputRedirector *global =
@@ -1225,7 +1234,7 @@ PyObject *PythonContext::outstream_write
if(context)
break;

- frame = frame->f_back;
+ frame = PyFrame_GetBack(frame);
}
}

@@ -1248,7 +1257,7 @@ PyObject *PythonContext::outstream_write

if(frame)
{
- filename = ToQStr(frame->f_code->co_filename);
+ filename = ToQStr(PyFrame_GetCode(frame)->co_filename);
line = PyFrame_GetLineNumber(frame);
}

@@ -1278,7 +1287,7 @@ int PythonContext::traceEvent(PyObject *
PythonContext *context = (PythonContext *)thisint;

PyObject *compiled = PyDict_GetItemString(obj, "compiled");
- if(compiled == (PyObject *)frame->f_code && what == PyTrace_LINE)
+ if(compiled == (PyObject *)PyFrame_GetCode(frame) && what == PyTrace_LINE)
{
context->location.line = PyFrame_GetLineNumber(frame);

@@ -1361,7 +1370,7 @@ extern "C" void HandleException(PyObject

if(frame)
{
- filename = ToQStr(frame->f_code->co_filename);
+ filename = ToQStr(PyFrame_GetCode(frame)->co_filename);
linenum = PyFrame_GetLineNumber(frame);
}

4 changes: 1 addition & 3 deletions srcpkgs/renderdoc/patches/qmake-no-rpath.patch
@@ -1,8 +1,6 @@
Index: qrenderdoc/CMakeLists.txt
===================================================================
--- a/qrenderdoc/CMakeLists.txt
+++ b/qrenderdoc/CMakeLists.txt
@@ -144,7 +144,7 @@ endif()
@@ -174,7 +174,7 @@ endif()
# and finding dependencies from the cmake build
file(WRITE
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
Expand Down
10 changes: 10 additions & 0 deletions srcpkgs/renderdoc/patches/time_t.patch
@@ -0,0 +1,10 @@
--- a/renderdoc/os/os_specific.h
+++ b/renderdoc/os/os_specific.h
@@ -35,6 +35,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#include <time.h>
#include <functional>
#include "api/replay/rdcarray.h"
#include "api/replay/rdcpair.h"
19 changes: 11 additions & 8 deletions srcpkgs/renderdoc/patches/unvendor-zstd-lz4.patch
@@ -1,13 +1,16 @@
Index: renderdoc/CMakeLists.txt
===================================================================
--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -213,54 +213,10 @@ set(sources
3rdparty/pugixml/pugixml.cpp
3rdparty/pugixml/pugixml.hpp
3rdparty/pugixml/pugiconfig.hpp
@@ -225,59 +225,12 @@ set(sources
3rdparty/aosp/android_manifest.h
3rdparty/catch/catch.cpp
3rdparty/catch/catch.hpp
- 3rdparty/pugixml/pugixml.cpp
- 3rdparty/pugixml/pugixml.hpp
- 3rdparty/pugixml/pugiconfig.hpp
- 3rdparty/lz4/lz4.c
- 3rdparty/lz4/lz4.h
3rdparty/md5/md5.c
3rdparty/md5/md5.h
3rdparty/miniz/miniz.c
3rdparty/miniz/miniz.h
3rdparty/superluminal/superluminal.cpp
Expand Down Expand Up @@ -57,11 +60,11 @@ Index: renderdoc/CMakeLists.txt
3rdparty/stb/stb_image.h
3rdparty/stb/stb_image_write.h
3rdparty/stb/stb_image_resize.h
@@ -271,6 +227,8 @@ set(sources
@@ -288,6 +241,8 @@ set(sources
3rdparty/tinyfiledialogs/tinyfiledialogs.c
3rdparty/tinyfiledialogs/tinyfiledialogs.h)

+list(APPEND RDOC_LIBRARIES -llz4 -lzstd)
+list(APPEND RDOC_LIBRARIES -lpugixml -llz4 -lzstd)
+
if(ANDROID)
list(APPEND sources
Expand Down

0 comments on commit 4e19a50

Please sign in to comment.