Skip to content

Commit

Permalink
Fix loading RenderDoc in offline mode for Linux (shadps4-emu#1968)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoquang2708 authored and Younes-Bel committed Dec 29, 2024
1 parent 0cb6d7d commit c1fefdc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/video_core/renderdoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,18 @@ void LoadRenderDoc() {
#else
static constexpr const char RENDERDOC_LIB[] = "librenderdoc.so";
#endif
if (void* mod = dlopen(RENDERDOC_LIB, RTLD_NOW | RTLD_NOLOAD)) {
const auto RENDERDOC_GetAPI =
reinterpret_cast<pRENDERDOC_GetAPI>(dlsym(mod, "RENDERDOC_GetAPI"));
const s32 ret = RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_6_0, (void**)&rdoc_api);
ASSERT(ret == 1);
// Check if we are running by RDoc GUI
void* mod = dlopen(RENDERDOC_LIB, RTLD_NOW | RTLD_NOLOAD);
if (!mod && Config::isRdocEnabled()) {
// If enabled in config, try to load RDoc runtime in offline mode
if ((mod = dlopen(RENDERDOC_LIB, RTLD_NOW))) {
const auto RENDERDOC_GetAPI =
reinterpret_cast<pRENDERDOC_GetAPI>(dlsym(mod, "RENDERDOC_GetAPI"));
const s32 ret = RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_6_0, (void**)&rdoc_api);
ASSERT(ret == 1);
} else {
LOG_ERROR(Render, "Cannot load RenderDoc: {}", dlerror());
}
}
#endif
if (rdoc_api) {
Expand Down

0 comments on commit c1fefdc

Please sign in to comment.