diff --git a/srcpkgs/renderdoc/patches/101dbda8c34888bf2051c3c257da3a1702705ef9.patch b/srcpkgs/renderdoc/patches/101dbda8c34888bf2051c3c257da3a1702705ef9.patch deleted file mode 100644 index 9c6bc936f0822e..00000000000000 --- a/srcpkgs/renderdoc/patches/101dbda8c34888bf2051c3c257da3a1702705ef9.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 101dbda8c34888bf2051c3c257da3a1702705ef9 Mon Sep 17 00:00:00 2001 -From: baldurk -Date: Tue, 18 Oct 2022 10:21:04 +0100 -Subject: [PATCH] Handle GL hooks called during replay from injected code. Refs - #2752 - ---- - renderdoc/driver/gl/egl_hooks.cpp | 9 ++++++- - renderdoc/driver/gl/gl_hooks.cpp | 43 +++++++++++++++++++------------ - renderdoc/driver/gl/glx_hooks.cpp | 20 ++++++++++++-- - 3 files changed, 52 insertions(+), 20 deletions(-) - -diff --git a/renderdoc/driver/gl/egl_hooks.cpp b/renderdoc/driver/gl/egl_hooks.cpp -index a3aa0cfc2a..09e69c0079 100644 ---- a/renderdoc/driver/gl/egl_hooks.cpp -+++ b/renderdoc/driver/gl/egl_hooks.cpp -@@ -447,9 +447,16 @@ HOOK_EXPORT EGLBoolean EGLAPIENTRY eglMakeCurrent_renderdoc_hooked(EGLDisplay di - { - if(RenderDoc::Inst().IsReplayApp()) - { -- if(!EGL.MakeCurrent) -+ if(!EGL.MakeCurrent || !EGL.GetProcAddress) - EGL.PopulateForReplay(); - -+ // populate GL function pointers now in case linked functions are called -+ if(EGL.GetProcAddress) -+ { -+ GL.PopulateWithCallback( -+ [](const char *funcName) -> void * { return (void *)EGL.GetProcAddress(funcName); }); -+ } -+ - return EGL.MakeCurrent(display, draw, read, ctx); - } - -diff --git a/renderdoc/driver/gl/gl_hooks.cpp b/renderdoc/driver/gl/gl_hooks.cpp -index 369f924bea..7e5a0ac073 100644 ---- a/renderdoc/driver/gl/gl_hooks.cpp -+++ b/renderdoc/driver/gl/gl_hooks.cpp -@@ -124,7 +124,6 @@ void DisableGLHooks() - glhook.enabled = false; - } - --#if ENABLED(RDOC_WIN32) || ENABLED(RDOC_APPLE) || ENABLED(RDOC_SWITCH) - template - ret_type default_ret() - { -@@ -136,24 +135,34 @@ void default_ret() - { - } - --// if we were injected and aren't ready to capture, skip out and call the real function --#define UNINIT_CALL(function, ...) \ -- if(!glhook.enabled) \ -- { \ -- if(GL.function == NULL) \ -- { \ -- RDCERR("No function pointer for '%s' while uninitialised!", STRINGIZE(function)); \ -- return default_ret(); \ -- } \ -- return GL.function(__VA_ARGS__); \ -- } -- --#else -+template <> -+const char *default_ret() -+{ -+ return ""; -+} - --// nothing to do - we always assume we are ready to capture --#define UNINIT_CALL(function, ...) -+template <> -+const GLubyte *default_ret() -+{ -+ return (const GLubyte *)""; -+} - --#endif -+// on windows we can be injected and not ready to capture when we intercept a GL call. If that -+// happens we need to skip and call the real function -+ -+// on linux some systems inject external code into Qt which initialises GL behind our back. If this -+// calls glXGetProcAddress it will get the real function pointers, but if it links against GL it -+// will get routed here via our public exported symbols so we try to call the real function -+#define UNINIT_CALL(function, ...) \ -+ if(!glhook.enabled) \ -+ { \ -+ if(GL.function == NULL) \ -+ { \ -+ RDCERR("No function pointer for '%s' while doing replay fallback!", STRINGIZE(function)); \ -+ return default_ret(); \ -+ } \ -+ return GL.function(__VA_ARGS__); \ -+ } - - DefineSupportedHooks(); - DefineUnsupportedHooks(); -diff --git a/renderdoc/driver/gl/glx_hooks.cpp b/renderdoc/driver/gl/glx_hooks.cpp -index 5030fe8dfb..5bf2202eca 100644 ---- a/renderdoc/driver/gl/glx_hooks.cpp -+++ b/renderdoc/driver/gl/glx_hooks.cpp -@@ -353,9 +353,17 @@ HOOK_EXPORT Bool glXMakeCurrent_renderdoc_hooked(Display *dpy, GLXDrawable drawa - { - if(RenderDoc::Inst().IsReplayApp()) - { -- if(!GLX.glXMakeCurrent) -+ if(!GLX.glXMakeCurrent || !GLX.glXGetProcAddress) - GLX.PopulateForReplay(); - -+ // populate GL function pointers now in case linked functions are called -+ if(GLX.glXGetProcAddress) -+ { -+ GL.PopulateWithCallback([](const char *funcName) -> void * { -+ return (void *)GLX.glXGetProcAddress((const GLubyte *)funcName); -+ }); -+ } -+ - return GLX.glXMakeCurrent(dpy, drawable, ctx); - } - -@@ -425,9 +433,17 @@ HOOK_EXPORT Bool glXMakeContextCurrent_renderdoc_hooked(Display *dpy, GLXDrawabl - { - if(RenderDoc::Inst().IsReplayApp()) - { -- if(!GLX.glXMakeContextCurrent) -+ if(!GLX.glXMakeContextCurrent || !GLX.glXGetProcAddress) - GLX.PopulateForReplay(); - -+ // populate GL function pointers now in case linked functions are called -+ if(GLX.glXGetProcAddress) -+ { -+ GL.PopulateWithCallback([](const char *funcName) -> void * { -+ return (void *)GLX.glXGetProcAddress((const GLubyte *)funcName); -+ }); -+ } -+ - return GLX.glXMakeContextCurrent(dpy, draw, read, ctx); - } - diff --git a/srcpkgs/renderdoc/patches/atomic.patch b/srcpkgs/renderdoc/patches/atomic.patch deleted file mode 100644 index 456572f5969a86..00000000000000 --- a/srcpkgs/renderdoc/patches/atomic.patch +++ /dev/null @@ -1,45 +0,0 @@ -@q66: replace old __sync stuff with equivalent modern ones, -so we can use libatomic on targets without atomic8 support - ---- a/renderdoc/os/posix/posix_threading.cpp -+++ b/renderdoc/os/posix/posix_threading.cpp -@@ -43,32 +43,33 @@ namespace Atomic - { - int32_t Inc32(int32_t *i) - { -- return __sync_add_and_fetch(i, int32_t(1)); -+ return __atomic_add_fetch(i, int32_t(1), __ATOMIC_SEQ_CST); - } - - int32_t Dec32(int32_t *i) - { -- return __sync_add_and_fetch(i, int32_t(-1)); -+ return __atomic_sub_fetch(i, int32_t(1), __ATOMIC_SEQ_CST); - } - - int64_t Inc64(int64_t *i) - { -- return __sync_add_and_fetch(i, int64_t(1)); -+ return __atomic_add_fetch(i, int64_t(1), __ATOMIC_SEQ_CST); - } - - int64_t Dec64(int64_t *i) - { -- return __sync_add_and_fetch(i, int64_t(-1)); -+ return __atomic_sub_fetch(i, int64_t(1), __ATOMIC_SEQ_CST); - } - - int64_t ExchAdd64(int64_t *i, int64_t a) - { -- return __sync_add_and_fetch(i, int64_t(a)); -+ return __atomic_add_fetch(i, a, __ATOMIC_SEQ_CST); - } - - int32_t CmpExch32(int32_t *dest, int32_t oldVal, int32_t newVal) - { -- return __sync_val_compare_and_swap(dest, oldVal, newVal); -+ __atomic_compare_exchange_n(dest, &oldVal, newVal, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); -+ return oldVal; - } - }; - diff --git a/srcpkgs/renderdoc/patches/c++14-needed.patch b/srcpkgs/renderdoc/patches/c++14-needed.patch deleted file mode 100644 index 17f623ec8dee59..00000000000000 --- a/srcpkgs/renderdoc/patches/c++14-needed.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fno-strict-aliasing") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") - if(ENABLE_GGP) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gline-tables-only -fno-omit-frame-pointer") diff --git a/srcpkgs/renderdoc/patches/compressonator-only-x86.patch b/srcpkgs/renderdoc/patches/compressonator-only-x86.patch deleted file mode 100644 index aad50bea773aec..00000000000000 --- a/srcpkgs/renderdoc/patches/compressonator-only-x86.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Jordan Justen -Date: Wed, 29 Jul 2020 02:26:27 -0700 -Subject: replay: Only support compressonator on x86 - -Signed-off-by: Jordan Justen ---- - renderdoc/CMakeLists.txt | 2 +- - renderdoc/replay/replay_driver.cpp | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - ---- a/renderdoc/CMakeLists.txt -+++ b/renderdoc/CMakeLists.txt -@@ -355,7 +355,7 @@ elseif(UNIX) - os/posix/posix_specific.h) - endif() - --if(NOT ANDROID) -+if(RENDERDOC_X86_PROC_FAMILY) - list(APPEND sources - 3rdparty/compressonator/BC1_Encode_kernel.cpp - 3rdparty/compressonator/BC2_Encode_kernel.cpp ---- a/renderdoc/replay/replay_driver.cpp -+++ b/renderdoc/replay/replay_driver.cpp -@@ -1647,8 +1647,8 @@ bytebuf GetDiscardPattern(DiscardType ty - fmt.type == ResourceFormatType::BC5 || fmt.type == ResourceFormatType::BC6 || - fmt.type == ResourceFormatType::BC7) - { --#if ENABLED(RDOC_ANDROID) -- RDCERR("Format %s not supported on android", fmt.Name().c_str()); -+#if DISABLED(RDOC_X86_FAMILY) -+ RDCERR("Format %s is only supported on x86", fmt.Name().c_str()); - #else - const uint16_t whalf = ConvertToHalf(1000.0f); - diff --git a/srcpkgs/renderdoc/patches/dostringise.patch b/srcpkgs/renderdoc/patches/dostringise.patch deleted file mode 100644 index db98ec7874a0bd..00000000000000 --- a/srcpkgs/renderdoc/patches/dostringise.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Jordan Justen -Date: Fri, 24 Jul 2020 15:36:34 -0700 -Subject: renderdoc/serialise: Add DoStringise(const long &el) for 32-bit x86 - on GCC - -linux_process.cpp was generating linker errors: - -undefined reference to `rdcstr DoStringise(long const&) - -Signed-off-by: Jordan Justen ---- - renderdoc/serialise/serialiser.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/renderdoc/serialise/serialiser.cpp -+++ b/renderdoc/serialise/serialiser.cpp -@@ -985,6 +985,14 @@ rdcstr DoStringise(const int16_t &el) - return StringFormat::Fmt("%hd", el); - } - -+#if ENABLED(RDOC_LINUX) && ENABLED(RDOC_X86_FAMILY) && DISABLED(RDOC_X64) -+template <> -+rdcstr DoStringise(const long &el) -+{ -+ return StringFormat::Fmt("%l", el); -+} -+#endif -+ - template <> - rdcstr DoStringise(const float &el) - { diff --git a/srcpkgs/renderdoc/patches/ptrace-only-x86.patch b/srcpkgs/renderdoc/patches/ptrace-only-x86.patch deleted file mode 100644 index 84135ffb7095b3..00000000000000 --- a/srcpkgs/renderdoc/patches/ptrace-only-x86.patch +++ /dev/null @@ -1,60 +0,0 @@ -Note @q66: the ptrace code has x86-isms in it, which would need to -be patched out anyway. - -From: Jordan Justen -Date: Tue, 28 Jul 2020 17:12:12 -0700 -Subject: linux_process: Only use ptrace for x86 family processors - -Although ptrace should be usable for other processor families, for now -simply skipping the paths seems to work. I tested this by skipping the -ptrace paths on x86. - -Signed-off-by: Jordan Justen ---- - renderdoc/os/posix/linux/linux_process.cpp | 21 +++++++++++++++++++++ - 1 file changed, 21 insertions(+) - ---- a/renderdoc/os/posix/linux/linux_process.cpp -+++ b/renderdoc/os/posix/linux/linux_process.cpp -@@ -55,6 +55,8 @@ extern char **environ; - #define INITIAL_WAIT_TIME 1 - #define MAX_WAIT_TIME 0xfffff - -+#define USE_PTRACE (ENABLED(RDOC_X86_FAMILY)) -+ - char **GetCurrentEnvironment() - { - return environ; -@@ -155,6 +157,8 @@ int GetIdentPort(pid_t childPid) - return ret; - } - -+#if USE_PTRACE -+ - static bool ptrace_scope_ok() - { - if(!Linux_PtraceChildProcesses()) -@@ -617,6 +621,23 @@ void ResumeProcess(pid_t childPid, uint3 - } - } - -+#else // #if USE_PTRACE -+ -+bool StopChildAtMain(pid_t childPid) -+{ -+ return false; -+} -+ -+void StopAtMainInChild() -+{ -+} -+ -+void ResumeProcess(pid_t childPid, uint32_t delaySeconds) -+{ -+} -+ -+#endif -+ - // because OSUtility::DebuggerPresent is called often we want it to be - // cheap. Opening and parsing a file would cause high overhead on each - // call, so instead we just cache it at startup. This fails in the case diff --git a/srcpkgs/renderdoc/patches/python-3.11.patch b/srcpkgs/renderdoc/patches/python-3.11.patch deleted file mode 100644 index cfa65291821cfb..00000000000000 --- a/srcpkgs/renderdoc/patches/python-3.11.patch +++ /dev/null @@ -1,151 +0,0 @@ -Index: renderdoc-1.21/qrenderdoc/Code/pyrenderdoc/function_conversion.h -=================================================================== ---- renderdoc-1.21.orig/qrenderdoc/Code/pyrenderdoc/function_conversion.h -+++ renderdoc-1.21/qrenderdoc/Code/pyrenderdoc/function_conversion.h -@@ -301,13 +301,30 @@ funcType ConvertFunc(const char *funcnam - { - _frame *frame = PyEval_GetFrame(); - -+#if PY_VERSION_HEX >= 0x030B0000 -+ Py_INCREF(frame); -+#endif - while(frame) - { -+#if PY_VERSION_HEX >= 0x030B0000 -+ PyObject *f_globals = PyFrame_GetGlobals(frame); -+ global_internal_handle = PyDict_GetItemString(f_globals, "_renderdoc_internal"); -+ Py_DECREF(f_globals); -+#else - global_internal_handle = PyDict_GetItemString(frame->f_globals, "_renderdoc_internal"); -+#endif - - if(global_internal_handle) - break; -+#if PY_VERSION_HEX >= 0x03090000 -+ do { -+ PyFrameObject *f_back = PyFrame_GetBack(frame); -+ Py_DECREF(frame); -+ frame = f_back; -+ } while (0); -+#else - frame = frame->f_back; -+#endif - } - } - -Index: renderdoc-1.21/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp -=================================================================== ---- renderdoc-1.21.orig/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp -+++ renderdoc-1.21/qrenderdoc/Code/pyrenderdoc/PythonContext.cpp -@@ -85,6 +85,33 @@ extern "C" PyObject *PyInit_qrenderdoc(v - extern "C" PyObject *WrapBareQWidget(QWidget *); - extern "C" QWidget *UnwrapBareQWidget(PyObject *); - -+#if PY_VERSION_HEX <=0x030B0000 -+static inline PyObject * -+PyFrame_GetGlobals(PyFrameObject *frame) -+{ -+ PyObject *f_globals = frame->f_globals; -+ Py_INCREF(f_globals); -+ return f_globals; -+} -+#endif -+ -+#if PY_VERSION_HEX <=0x03090000 -+static inline PyFrameObject * -+PyFrame_GetBack(PyFrameObject *frame) -+{ -+ PyFrameObject *f_back = frame->f_back; -+ Py_INCREF(f_back); -+ return f_back; -+} -+static inline PyCodeObject * -+PyFrame_GetCode(PyFrameObject *frame) -+{ -+ PyCodeObject *f_code = frame->f_code; -+ Py_INCREF(f_code); -+ return 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) - { -@@ -1211,21 +1238,28 @@ PyObject *PythonContext::outstream_write - { - _frame *frame = PyEval_GetFrame(); - -+ Py_XINCREF(frame); -+ - while(frame) - { -- PyObject *globals = frame->f_globals; -+ PyFrameObject *oframe = frame; -+ PyObject *globals = PyFrame_GetGlobals(frame); - if(globals) - { -+ Py_DECREF(globals); - OutputRedirector *global = - (OutputRedirector *)PyDict_GetItemString(globals, "_renderdoc_internal"); -- if(global) -+ if(global) { - context = global->context; -+ Py_DECREF(globals); -+ } - } - - if(context) - break; - -- frame = frame->f_back; -+ frame = PyFrame_GetBack(frame); -+ Py_DECREF(oframe); - } - } - -@@ -1239,6 +1273,7 @@ PyObject *PythonContext::outstream_write - rdcstr message = text; - - _frame *frame = PyEval_GetFrame(); -+ Py_XINCREF(frame); - - while(message.back() == '\n' || message.back() == '\r') - message.pop_back(); -@@ -1248,7 +1283,9 @@ PyObject *PythonContext::outstream_write - - if(frame) - { -- filename = ToQStr(frame->f_code->co_filename); -+ PyCodeObject *code = PyFrame_GetCode(frame); -+ filename = ToQStr(code->co_filename); -+ Py_DECREF(code); - line = PyFrame_GetLineNumber(frame); - } - -@@ -1278,12 +1315,14 @@ int PythonContext::traceEvent(PyObject * - PythonContext *context = (PythonContext *)thisint; - - PyObject *compiled = PyDict_GetItemString(obj, "compiled"); -- if(compiled == (PyObject *)frame->f_code && what == PyTrace_LINE) -+ PyCodeObject *code = PyFrame_GetCode(frame); -+ if(compiled == (PyObject *)code && what == PyTrace_LINE) - { - context->location.line = PyFrame_GetLineNumber(frame); - - emit context->traceLine(context->location.file, context->location.line); - } -+ Py_DECREF(code); - - if(context->shouldAbort()) - { -@@ -1361,7 +1400,9 @@ extern "C" void HandleException(PyObject - - if(frame) - { -- filename = ToQStr(frame->f_code->co_filename); -+ PyCodeObject *code = PyFrame_GetCode(frame); -+ filename = ToQStr(code->co_filename); -+ Py_DECREF(code); - linenum = PyFrame_GetLineNumber(frame); - } - diff --git a/srcpkgs/renderdoc/patches/python-3.13.patch b/srcpkgs/renderdoc/patches/python-3.13.patch deleted file mode 100644 index 6e17cf58902c6b..00000000000000 --- a/srcpkgs/renderdoc/patches/python-3.13.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/qrenderdoc/Code/pyrenderdoc/renderdoc.i -+++ b/qrenderdoc/Code/pyrenderdoc/renderdoc.i -@@ -469,7 +469,7 @@ - // for basic types, return the repr directly - if(obj == (PyObject *)&_Py_TrueStruct || - obj == (PyObject *)&_Py_FalseStruct || -- PyObject_IsInstance(obj, (PyObject*)&_PyNone_Type) || -+ obj == (PyObject *)Py_None || - PyObject_IsInstance(obj, (PyObject*)&PyFloat_Type) || - PyObject_IsInstance(obj, (PyObject*)&PyLong_Type) || - PyObject_IsInstance(obj, (PyObject*)&PyBytes_Type) || diff --git a/srcpkgs/renderdoc/template b/srcpkgs/renderdoc/template index f1569f7bda1ce8..403b5edfea441c 100644 --- a/srcpkgs/renderdoc/template +++ b/srcpkgs/renderdoc/template @@ -1,7 +1,7 @@ # Template file for 'renderdoc' pkgname=renderdoc -version=1.21 -revision=6 +version=1.45 +revision=1 _plt_ver=dbadbe14d601913b81a4a7533b284b6ccd7351d8 build_style=cmake configure_args="-DENABLE_GL=ON -DENABLE_GLES=ON -DENABLE_QRENDERDOC=ON @@ -23,7 +23,7 @@ distfiles="https://github.com/baldurk/${pkgname}/archive/v${version}.tar.gz https://raw.githubusercontent.com/kubo/plthook/${_plt_ver}/plthook_elf.c https://github.com/baldurk/swig/archive/renderdoc-modified-7.zip " -checksum="7c12546857ffd4521a859f45161224b0f89aa6f951cfbca2bfbe22db9c2f95a6 +checksum="8d089ff4354c041a6ac3cb1628a30cc1020b9aa8934bcaabafbe4304af865ede 2a30a118858ba1d5753f365a375cc93020012a35e3f596dcdb490ad70519cdb5 68c858dcb829e07bb60d47fbb962b240797dd82960a53c25ac69513e90aff6fa 9d7e5013ada6c42ec95ab167a34db52c1cc8c09b89c8e9373631b1f10596c648"