mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 10:36:43 +00:00
Unify feature macro handling
This commit is contained in:
@@ -126,8 +126,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_definitions(-DRENDERDOC_PLATFORM_POSIX)
|
||||
|
||||
if(ANDROID)
|
||||
add_definitions(-DRENDERDOC_PLATFORM_ANDROID)
|
||||
elseif(APPLE)
|
||||
|
||||
@@ -39,7 +39,8 @@ typedef uint32_t bool32;
|
||||
#endif
|
||||
#define RENDERDOC_CC __cdecl
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_POSIX)
|
||||
#elif defined(RENDERDOC_PLATFORM_LINUX) || defined(RENDERDOC_PLATFORM_APPLE) || \
|
||||
defined(RENDERDOC_PLATFORM_ANDROID)
|
||||
|
||||
#ifdef RENDERDOC_EXPORTS
|
||||
#define RENDERDOC_API __attribute__((visibility("default")))
|
||||
|
||||
@@ -111,7 +111,7 @@ bool Vec16NotEqual(void *a, void *b)
|
||||
}
|
||||
|
||||
return false;
|
||||
#elif defined(WIN64)
|
||||
#elif ENABLED(RDOC_X64)
|
||||
uint64_t *a64 = (uint64_t *)a;
|
||||
uint64_t *b64 = (uint64_t *)b;
|
||||
|
||||
@@ -244,7 +244,7 @@ uint32_t Log2Floor(uint32_t value)
|
||||
return 31 - Bits::CountLeadingZeroes(value);
|
||||
}
|
||||
|
||||
#if RDC64BIT
|
||||
#if ENABLED(RDOC_X64)
|
||||
uint64_t Log2Floor(uint64_t value)
|
||||
{
|
||||
RDCASSERT(value > 0);
|
||||
@@ -312,20 +312,20 @@ void rdclogprint_int(LogType type, const char *fullMsg, const char *msg)
|
||||
|
||||
SCOPED_LOCK(lock);
|
||||
|
||||
#if defined(OUTPUT_LOG_TO_DEBUG_OUT)
|
||||
#if ENABLED(OUTPUT_LOG_TO_DEBUG_OUT)
|
||||
OSUtility::WriteOutput(OSUtility::Output_DebugMon, fullMsg);
|
||||
#endif
|
||||
#if defined(OUTPUT_LOG_TO_STDOUT)
|
||||
#if ENABLED(OUTPUT_LOG_TO_STDOUT)
|
||||
// don't output debug messages to stdout/stderr
|
||||
if(type != RDCLog_Debug && log_output_enabled)
|
||||
OSUtility::WriteOutput(OSUtility::Output_StdOut, msg);
|
||||
#endif
|
||||
#if defined(OUTPUT_LOG_TO_STDERR)
|
||||
#if ENABLED(OUTPUT_LOG_TO_STDERR)
|
||||
// don't output debug messages to stdout/stderr
|
||||
if(type != RDCLog_Debug && log_output_enabled)
|
||||
OSUtility::WriteOutput(OSUtility::Output_StdErr, msg);
|
||||
#endif
|
||||
#if defined(OUTPUT_LOG_TO_DISK)
|
||||
#if ENABLED(OUTPUT_LOG_TO_DISK)
|
||||
if(logfileHandle)
|
||||
{
|
||||
// strlen used as byte length - str is UTF-8 so this is NOT number of characters
|
||||
@@ -350,12 +350,12 @@ void rdclog_int(LogType type, const char *project, const char *file, unsigned in
|
||||
va_start(args, fmt);
|
||||
|
||||
char timestamp[64] = {0};
|
||||
#if defined(INCLUDE_TIMESTAMP_IN_LOG)
|
||||
#if ENABLED(INCLUDE_TIMESTAMP_IN_LOG)
|
||||
StringFormat::sntimef(timestamp, 63, "[%H:%M:%S] ");
|
||||
#endif
|
||||
|
||||
char location[64] = {0};
|
||||
#if defined(INCLUDE_LOCATION_IN_LOG)
|
||||
#if ENABLED(INCLUDE_LOCATION_IN_LOG)
|
||||
string loc;
|
||||
loc = basename(string(file));
|
||||
StringFormat::snprintf(location, 63, "% 20s(%4d) - ", loc.c_str(), line);
|
||||
|
||||
@@ -158,7 +158,7 @@ bool FindDiffRange(void *a, void *b, size_t bufSize, size_t &diffStart, size_t &
|
||||
uint32_t CalcNumMips(int Width, int Height, int Depth);
|
||||
|
||||
uint32_t Log2Floor(uint32_t value);
|
||||
#if RDC64BIT
|
||||
#if ENABLED(RDOC_X64)
|
||||
uint64_t Log2Floor(uint64_t value);
|
||||
#endif
|
||||
|
||||
@@ -171,7 +171,7 @@ uint64_t Log2Floor(uint64_t value);
|
||||
OSUtility::ForceCrash(); \
|
||||
} while((void)0, 0)
|
||||
|
||||
#if !defined(RELEASE) || defined(FORCE_DEBUGBREAK)
|
||||
#if ENABLED(RDOC_DEVEL) || ENABLED(FORCE_DEBUGBREAK)
|
||||
#define RDCBREAK() \
|
||||
do \
|
||||
{ \
|
||||
@@ -207,7 +207,7 @@ enum LogType
|
||||
RDCLog_NumTypes,
|
||||
};
|
||||
|
||||
#if defined(STRIP_LOG)
|
||||
#if ENABLED(STRIP_LOG)
|
||||
#define RDCLOGFILE(fn) \
|
||||
do \
|
||||
{ \
|
||||
@@ -274,7 +274,7 @@ void rdclog_closelog();
|
||||
#define RDCLOGOUTPUT() rdclog_enableoutput()
|
||||
#define RDCSTOPLOGGING() rdclog_closelog()
|
||||
|
||||
#if(!defined(RELEASE) || defined(FORCE_DEBUG_LOGS)) && !defined(STRIP_DEBUG_LOGS)
|
||||
#if(ENABLED(RDOC_DEVEL) || ENABLED(FORCE_DEBUG_LOGS)) && DISABLED(STRIP_DEBUG_LOGS)
|
||||
#define RDCDEBUG(...) rdclog(RDCLog_Debug, __VA_ARGS__)
|
||||
#else
|
||||
#define RDCDEBUG(...) \
|
||||
@@ -286,7 +286,7 @@ void rdclog_closelog();
|
||||
#define RDCLOG(...) rdclog(RDCLog_Comment, __VA_ARGS__)
|
||||
#define RDCWARN(...) rdclog(RDCLog_Warning, __VA_ARGS__)
|
||||
|
||||
#if defined(DEBUGBREAK_ON_ERROR_LOG)
|
||||
#if ENABLED(DEBUGBREAK_ON_ERROR_LOG)
|
||||
#define RDCERR(...) \
|
||||
do \
|
||||
{ \
|
||||
@@ -320,7 +320,7 @@ void rdclog_closelog();
|
||||
// Assert
|
||||
//
|
||||
|
||||
#if !defined(RELEASE) || defined(FORCE_ASSERTS)
|
||||
#if ENABLED(RDOC_DEVEL) || ENABLED(FORCE_ASSERTS)
|
||||
void rdcassert(const char *msg, const char *file, unsigned int line, const char *func);
|
||||
|
||||
// this defines the root macro, RDCASSERTMSG(msg, cond, ...)
|
||||
@@ -344,7 +344,7 @@ void rdcassert(const char *msg, const char *file, unsigned int line, const char
|
||||
// Compile asserts
|
||||
//
|
||||
|
||||
#if defined(STRIP_COMPILE_ASSERTS)
|
||||
#if ENABLED(STRIP_COMPILE_ASSERTS)
|
||||
#define RDCCOMPILE_ASSERT(condition, message) \
|
||||
do \
|
||||
{ \
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
#define RDCASSERT_GETCOND(cond, ...) cond
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if ENABLED(RDOC_MSVS)
|
||||
|
||||
// only needed on VC++, but unfortunately breaks on g++/clang++
|
||||
#define RDCASSERT_FAILMSG_INVOKE(macro, args) macro args
|
||||
|
||||
@@ -25,11 +25,88 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Option macros
|
||||
// From: http://www.codersnotes.com/notes/easy-preprocessor-defines/
|
||||
|
||||
#define OPTION_ON +
|
||||
#define OPTION_OFF -
|
||||
#define ENABLED(opt) ((1 opt 1) == 2)
|
||||
#define DISABLED(opt) ((1 opt 1) == 0)
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Build/machine configuration
|
||||
#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || \
|
||||
defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
||||
#define RDC64BIT 1
|
||||
#define RDOC_X64 OPTION_ON
|
||||
#else
|
||||
#define RDOC_X64 OPTION_OFF
|
||||
#endif
|
||||
|
||||
#if defined(RELEASE) || defined(_RELEASE)
|
||||
#define RDOC_RELEASE OPTION_ON
|
||||
#define RDOC_DEVEL OPTION_OFF
|
||||
#else
|
||||
#define RDOC_RELEASE OPTION_OFF
|
||||
#define RDOC_DEVEL OPTION_ON
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define RDOC_MSVS OPTION_ON
|
||||
#else
|
||||
#define RDOC_MSVS OPTION_OFF
|
||||
#endif
|
||||
|
||||
// translate from build system defines, so they don't have to be defined to anything in
|
||||
// particular
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
|
||||
#define RDOC_WIN32 OPTION_ON
|
||||
#define RDOC_ANDROID OPTION_OFF
|
||||
#define RDOC_LINUX OPTION_OFF
|
||||
#define RDOC_APPLE OPTION_OFF
|
||||
#define RDOC_POSIX OPTION_OFF
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_ANDROID)
|
||||
|
||||
#define RDOC_WIN32 OPTION_OFF
|
||||
#define RDOC_ANDROID OPTION_ON
|
||||
#define RDOC_LINUX OPTION_OFF
|
||||
#define RDOC_APPLE OPTION_OFF
|
||||
#define RDOC_POSIX OPTION_ON
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_LINUX)
|
||||
|
||||
#define RDOC_WIN32 OPTION_OFF
|
||||
#define RDOC_ANDROID OPTION_OFF
|
||||
#define RDOC_LINUX OPTION_ON
|
||||
#define RDOC_APPLE OPTION_OFF
|
||||
#define RDOC_POSIX OPTION_ON
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_APPLE)
|
||||
|
||||
#define RDOC_WIN32 OPTION_OFF
|
||||
#define RDOC_ANDROID OPTION_OFF
|
||||
#define RDOC_LINUX OPTION_OFF
|
||||
#define RDOC_APPLE OPTION_ON
|
||||
#define RDOC_POSIX OPTION_ON
|
||||
|
||||
#else
|
||||
|
||||
#error "No platform configured in build system"
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#define RDOC_XLIB OPTION_ON
|
||||
#else
|
||||
#define RDOC_XLIB OPTION_OFF
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#define RDOC_XCB OPTION_ON
|
||||
#else
|
||||
#define RDOC_XCB OPTION_OFF
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
@@ -46,55 +123,51 @@ enum
|
||||
// Debugging features configuration
|
||||
|
||||
// remove all logging code
|
||||
//#define STRIP_LOG
|
||||
#define STRIP_LOG OPTION_OFF
|
||||
|
||||
// remove all compile time asserts. Normally done even in release
|
||||
// but this would speed up compilation
|
||||
//#define STRIP_COMPILE_ASSERTS
|
||||
#define STRIP_COMPILE_ASSERTS OPTION_OFF
|
||||
|
||||
// force asserts regardless of debug/release mode
|
||||
#define FORCE_ASSERTS
|
||||
#define FORCE_ASSERTS OPTION_ON
|
||||
|
||||
// force debugbreaks regardless of debug/release mode
|
||||
//#define FORCE_DEBUGBREAK
|
||||
#define FORCE_DEBUGBREAK OPTION_OFF
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Logging configuration
|
||||
|
||||
// error logs trigger a breakpoint
|
||||
#define DEBUGBREAK_ON_ERROR_LOG
|
||||
#define DEBUGBREAK_ON_ERROR_LOG OPTION_ON
|
||||
|
||||
// whether to include timestamp on log lines
|
||||
#define INCLUDE_TIMESTAMP_IN_LOG
|
||||
#define INCLUDE_TIMESTAMP_IN_LOG OPTION_ON
|
||||
|
||||
// whether to include file and line on log lines
|
||||
#define INCLUDE_LOCATION_IN_LOG
|
||||
#define INCLUDE_LOCATION_IN_LOG OPTION_ON
|
||||
|
||||
#if !defined(RENDERDOC_PLATFORM_WIN32)
|
||||
// logs go to stdout/stderr
|
||||
#define OUTPUT_LOG_TO_STDOUT
|
||||
//#define OUTPUT_LOG_TO_STDERR
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
|
||||
#define OUTPUT_LOG_TO_STDOUT OPTION_OFF
|
||||
#define OUTPUT_LOG_TO_STDERR OPTION_OFF
|
||||
|
||||
#else
|
||||
|
||||
#define OUTPUT_LOG_TO_STDOUT OPTION_ON
|
||||
#define OUTPUT_LOG_TO_STDERR OPTION_OFF
|
||||
|
||||
#endif
|
||||
|
||||
// logs go to debug output (visual studio output window)
|
||||
#define OUTPUT_LOG_TO_DEBUG_OUT
|
||||
#define OUTPUT_LOG_TO_DEBUG_OUT OPTION_ON
|
||||
|
||||
// logs go to disk
|
||||
#define OUTPUT_LOG_TO_DISK
|
||||
#define OUTPUT_LOG_TO_DISK OPTION_ON
|
||||
|
||||
// normally only in a debug build do we
|
||||
// include debug logs. This prints them all the time
|
||||
//#define FORCE_DEBUG_LOGS
|
||||
#define FORCE_DEBUG_LOGS OPTION_OFF
|
||||
// this strips them completely
|
||||
//#define STRIP_DEBUG_LOGS
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// optional features
|
||||
|
||||
#if defined(NVIDIA_PERFKIT_DIR)
|
||||
#define ENABLE_NVIDIA_PERFKIT
|
||||
#endif
|
||||
|
||||
#if defined(AMD_PERFAPI_DIR)
|
||||
#define ENABLE_AMD_PERFAPI
|
||||
#endif
|
||||
#define STRIP_DEBUG_LOGS OPTION_OFF
|
||||
|
||||
@@ -30,11 +30,9 @@
|
||||
#include "common.h"
|
||||
#include "threading.h"
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
#define INCLUDE_TYPE_NAMES
|
||||
#endif
|
||||
#define INCLUDE_TYPE_NAMES RDOC_DEVEL
|
||||
|
||||
#ifdef INCLUDE_TYPE_NAMES
|
||||
#if ENABLED(INCLUDE_TYPE_NAMES)
|
||||
template <class T>
|
||||
class GetTypeName
|
||||
{
|
||||
@@ -73,7 +71,7 @@ public:
|
||||
}
|
||||
|
||||
// warn when we need to allocate an additional pool
|
||||
#ifdef INCLUDE_TYPE_NAMES
|
||||
#if ENABLED(INCLUDE_TYPE_NAMES)
|
||||
RDCWARN("Ran out of free slots in %s pool!", GetTypeName<WrapType>::Name());
|
||||
#else
|
||||
RDCWARN("Ran out of free slots in pool 0x%p!", &m_ImmediatePool.items[0]);
|
||||
@@ -82,7 +80,7 @@ public:
|
||||
// allocate a new additional pool and use that to allocate from
|
||||
m_AdditionalPools.push_back(new ItemPool());
|
||||
|
||||
#ifdef INCLUDE_TYPE_NAMES
|
||||
#if ENABLED(INCLUDE_TYPE_NAMES)
|
||||
RDCDEBUG("WrappingPool[%d]<%s>: %p -> %p", (uint32_t)m_AdditionalPools.size() - 1,
|
||||
GetTypeName<WrapType>::Name(), &m_AdditionalPools.back()->items[0],
|
||||
&m_AdditionalPools.back()->items[AllocCount - 1]);
|
||||
@@ -135,7 +133,7 @@ public:
|
||||
}
|
||||
|
||||
// this is an error - deleting an object that we don't recognise
|
||||
#ifdef INCLUDE_TYPE_NAMES
|
||||
#if ENABLED(INCLUDE_TYPE_NAMES)
|
||||
RDCERR("Resource being deleted through wrong pool - 0x%p not a member of %s", p,
|
||||
GetTypeName<WrapType>::Name());
|
||||
#else
|
||||
@@ -151,7 +149,7 @@ public:
|
||||
private:
|
||||
WrappingPool()
|
||||
{
|
||||
#ifdef INCLUDE_TYPE_NAMES
|
||||
#if ENABLED(INCLUDE_TYPE_NAMES)
|
||||
// hack - print in kB because float printing relies on statics that might not be initialised
|
||||
// yet in loading order. Ugly :(
|
||||
RDCDEBUG("WrappingPool<%s> %d in %dkB: %p -> %p", GetTypeName<WrapType>::Name(), PoolCount,
|
||||
@@ -201,7 +199,7 @@ private:
|
||||
void *ret = (void *)&items[lastAlloc];
|
||||
allocated[lastAlloc] = true;
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
memset(ret, 0xb0, AllocByteSize);
|
||||
#endif
|
||||
|
||||
@@ -214,7 +212,7 @@ private:
|
||||
{
|
||||
RDCASSERT(IsAlloc(p));
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
if(!IsAlloc(p))
|
||||
{
|
||||
RDCERR("Resource being deleted through wrong pool - 0x%p not a memory of 0x%p", p, &items[0]);
|
||||
@@ -226,7 +224,7 @@ private:
|
||||
|
||||
allocated[idx] = false;
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
memset(p, 0xfe, DebugClear ? AllocByteSize : 0);
|
||||
#endif
|
||||
}
|
||||
@@ -258,7 +256,7 @@ private:
|
||||
void *operator new(size_t sz) { return m_Pool.Allocate(); } \
|
||||
void operator delete(void *p) { m_Pool.Deallocate(p); } \
|
||||
static bool IsAlloc(void *p) { return m_Pool.IsAlloc(p); }
|
||||
#ifdef INCLUDE_TYPE_NAMES
|
||||
#if ENABLED(INCLUDE_TYPE_NAMES)
|
||||
#define DECL_TYPENAME(a) \
|
||||
template <> \
|
||||
const char *GetTypeName<a>::Name() \
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "core/core.h"
|
||||
#include <time.h>
|
||||
#include <algorithm>
|
||||
#include "common/common.h"
|
||||
#include "common/dds_readwrite.h"
|
||||
#include "data/version.h"
|
||||
#include "hooks/hooks.h"
|
||||
@@ -191,7 +192,7 @@ void RenderDoc::RecreateCrashHandler()
|
||||
{
|
||||
UnloadCrashHandler();
|
||||
|
||||
#ifdef CRASH_HANDLER_ENABLED
|
||||
#if ENABLED(RDOC_CRASH_HANDLER)
|
||||
m_ExHandler = new CrashHandler(m_ExHandler);
|
||||
#endif
|
||||
|
||||
@@ -626,7 +627,7 @@ string RenderDoc::GetOverlayText(RDCDriver driver, uint32_t frameNumber, int fla
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
overlayText += StringFormat::Fmt("%llu chunks - %.2f MB\n", Chunk::NumLiveChunks(),
|
||||
float(Chunk::TotalMem()) / 1024.0f / 1024.0f);
|
||||
#endif
|
||||
@@ -691,7 +692,7 @@ Serialiser *RenderDoc::OpenWriteSerialiser(uint32_t frameNum, RDCInitParams *par
|
||||
{
|
||||
RDCASSERT(m_CurrentDriver != RDC_Unknown);
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#if USE_BREAKPAD && defined(RENDERDOC_OFFICIAL_BUILD)
|
||||
|
||||
#define CRASH_HANDLER_ENABLED
|
||||
#define RDOC_CRASH_HANDLER OPTION_ON
|
||||
|
||||
// breakpad
|
||||
#include "breakpad/client/windows/common/ipc_protocol.h"
|
||||
@@ -142,4 +142,8 @@ private:
|
||||
google_breakpad::ExceptionHandler *m_ExHandler;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#define RDOC_CRASH_HANDLER OPTION_OFF
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
// Win32 to try and hide less padding with the larger alignment requirement
|
||||
// of 8-byte pointers.
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32) && defined(RDC64BIT)
|
||||
#if ENABLED(RDOC_WIN32) && ENABLED(RDOC_X64)
|
||||
template <typename T, size_t actual, size_t expected>
|
||||
class oversized
|
||||
{
|
||||
|
||||
@@ -6985,7 +6985,7 @@ vector<PixelModification> D3D11DebugManager::PixelHistory(vector<EventUsage> eve
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(size_t h = 0; h < history.size(); h++)
|
||||
{
|
||||
PixelModification &hs = history[h];
|
||||
|
||||
@@ -104,7 +104,7 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device *real
|
||||
m_pRealContext3 = NULL;
|
||||
m_pRealContext->QueryInterface(__uuidof(ID3D11DeviceContext3), (void **)&m_pRealContext3);
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
|
||||
@@ -27,74 +27,12 @@
|
||||
#include "d3d11_debug.h"
|
||||
#include "d3d11_device.h"
|
||||
|
||||
#if defined(ENABLE_NVIDIA_PERFKIT)
|
||||
#define NVPM_INITGUID
|
||||
#include STRINGIZE(CONCAT(NVIDIA_PERFKIT_DIR, inc\\NvPmApi.h))
|
||||
|
||||
NvPmApi *nvAPI = NULL;
|
||||
|
||||
int enumFunc(NVPMCounterID id, const char *name)
|
||||
{
|
||||
RDCLOG("(% 4d): %s", id, name);
|
||||
|
||||
return NVPM_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
void D3D11DebugManager::PreDeviceInitCounters()
|
||||
{
|
||||
}
|
||||
|
||||
void D3D11DebugManager::PostDeviceInitCounters()
|
||||
{
|
||||
#if defined(ENABLE_NVIDIA_PERFKIT)
|
||||
HMODULE nvapi =
|
||||
LoadLibraryA(STRINGIZE(CONCAT(NVIDIA_PERFKIT_DIR, bin\\win7_x86\\NvPmApi.Core.dll)));
|
||||
if(nvapi == NULL)
|
||||
{
|
||||
RDCERR("Couldn't load perfkit");
|
||||
return;
|
||||
}
|
||||
|
||||
NVPMGetExportTable_Pfn NVPMGetExportTable =
|
||||
(NVPMGetExportTable_Pfn)GetProcAddress(nvapi, "NVPMGetExportTable");
|
||||
if(NVPMGetExportTable == NULL)
|
||||
{
|
||||
RDCERR("Couldn't Get Symbol 'NVPMGetExportTable'");
|
||||
return;
|
||||
}
|
||||
|
||||
NVPMRESULT nvResult = NVPMGetExportTable(&ETID_NvPmApi, (void **)&nvAPI);
|
||||
if(nvResult != NVPM_OK)
|
||||
{
|
||||
RDCERR("Couldn't NVPMGetExportTable");
|
||||
return;
|
||||
}
|
||||
|
||||
nvResult = nvAPI->Init();
|
||||
|
||||
if(nvResult != NVPM_OK)
|
||||
{
|
||||
RDCERR("Couldn't nvAPI->Init");
|
||||
return;
|
||||
}
|
||||
|
||||
NVPMContext context(0);
|
||||
nvResult = nvAPI->CreateContextFromD3D11Device(m_pDevice, &context);
|
||||
|
||||
if(nvResult != NVPM_OK)
|
||||
{
|
||||
RDCERR("Couldn't nvAPI->CreateContextFromD3D11Device");
|
||||
return;
|
||||
}
|
||||
|
||||
nvAPI->EnumCountersByContext(context, &enumFunc);
|
||||
|
||||
nvAPI->DestroyContext(context);
|
||||
nvAPI->Shutdown();
|
||||
nvAPI = NULL;
|
||||
FreeLibrary(nvapi);
|
||||
#endif
|
||||
}
|
||||
|
||||
void D3D11DebugManager::PreDeviceShutdownCounters()
|
||||
|
||||
@@ -297,7 +297,7 @@ void WrappedID3D11Device::NewSwapchainBuffer(IUnknown *backbuffer)
|
||||
|
||||
void WrappedID3D11Device::SetLogFile(const char *logfile)
|
||||
{
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -353,7 +353,7 @@ WrappedID3D11Device::WrappedID3D11Device(ID3D11Device *realDevice, D3D11InitPara
|
||||
|
||||
m_AppControlledCapture = false;
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -1163,7 +1163,7 @@ void WrappedID3D11Device::ReadLogInitialisation()
|
||||
|
||||
SetupDrawcallPointers(&m_Drawcalls, m_FrameRecord.drawcallList, NULL, NULL);
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(auto it = chunkInfos.begin(); it != chunkInfos.end(); ++it)
|
||||
{
|
||||
double dcount = double(it->second.count);
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
|
||||
// these are not required for success, but opportunistic to prevent AMD extensions from
|
||||
// activating and causing later crashes when not replayed correctly
|
||||
#if defined(RDC64BIT)
|
||||
#if ENABLED(RDOC_X64)
|
||||
AmdCreate11.Initialize("AmdDxExtCreate11", "atidxx64.dll", AmdCreate11_hook);
|
||||
#else
|
||||
AmdCreate11.Initialize("AmdDxExtCreate11", "atidxx32.dll", AmdCreate11_hook);
|
||||
|
||||
@@ -200,7 +200,7 @@ private:
|
||||
template <typename Dest>
|
||||
typename Dest::InnerType *Unwrap(typename Dest::InnerType *obj)
|
||||
{
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
if(obj && !Dest::IsAlloc(obj))
|
||||
{
|
||||
RDCERR("Trying to unwrap invalid type");
|
||||
|
||||
@@ -322,14 +322,14 @@ private:
|
||||
unsigned int m_ViewRefcount; // refcount from views (invisible to the end-user)
|
||||
|
||||
protected:
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
DescType m_Desc;
|
||||
#endif
|
||||
|
||||
WrappedResource11(NestedType *real, WrappedID3D11Device *device)
|
||||
: WrappedDeviceChild11(real, device), m_ViewRefcount(0)
|
||||
{
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
real->GetDesc(&m_Desc);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Close()
|
||||
if(m_Cmd->ShouldRerecordCmd(CommandList))
|
||||
{
|
||||
ID3D12GraphicsCommandList *list = m_Cmd->RerecordCmdList(CommandList);
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Ending partial command list for %llu baked to %llu", CommandList, bakeId);
|
||||
#endif
|
||||
|
||||
@@ -170,7 +170,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_Reset(ID3D12CommandAllocator *p
|
||||
{
|
||||
if(*it <= m_Cmd->m_LastEventID && m_Cmd->m_LastEventID < (*it + length))
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Reset - partial detected %u < %u < %u, %llu -> %llu", *it, m_Cmd->m_LastEventID,
|
||||
*it + length, CommandList, bakeId);
|
||||
#endif
|
||||
|
||||
@@ -134,7 +134,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
{
|
||||
ID3D12CommandList *list = Unwrap(cmds[i]);
|
||||
real->ExecuteCommandLists(1, &list);
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDevice->GPUSync();
|
||||
#endif
|
||||
}
|
||||
@@ -158,7 +158,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
real->ExecuteCommandLists(1, &list);
|
||||
}
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDevice->GPUSync();
|
||||
#endif
|
||||
}
|
||||
@@ -255,13 +255,13 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
}
|
||||
else if(m_Cmd.m_LastEventID <= startEID)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit no replay %u == %u", m_Cmd.m_LastEventID, startEID);
|
||||
#endif
|
||||
}
|
||||
else if(m_Cmd.m_DrawcallCallback && m_Cmd.m_DrawcallCallback->RecordAllCmds())
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit re-recording from %u", m_Cmd.m_RootEventID);
|
||||
#endif
|
||||
|
||||
@@ -271,7 +271,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
{
|
||||
ID3D12CommandList *cmd = m_Cmd.RerecordCmdList(cmdIds[c]);
|
||||
ResourceId rerecord = GetResID(cmd);
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit fully re-recorded replay of %llu, using %llu", cmdIds[c], rerecord);
|
||||
#endif
|
||||
rerecordedCmds.push_back(Unwrap(cmd));
|
||||
@@ -279,7 +279,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
m_pDevice->ApplyBarriers(m_Cmd.m_BakedCmdListInfo[rerecord].barriers);
|
||||
}
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
for(size_t i = 0; i < rerecordedCmds.size(); i++)
|
||||
{
|
||||
real->ExecuteCommandLists(1, &rerecordedCmds[i]);
|
||||
@@ -291,7 +291,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
}
|
||||
else if(m_Cmd.m_LastEventID > startEID && m_Cmd.m_LastEventID < m_Cmd.m_RootEventID)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit partial replay %u < %u", m_Cmd.m_LastEventID, m_Cmd.m_RootEventID);
|
||||
#endif
|
||||
|
||||
@@ -313,7 +313,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
ID3D12GraphicsCommandList *list =
|
||||
m_Cmd.RerecordCmdList(cmdIds[c], D3D12CommandData::Primary);
|
||||
ResourceId partial = GetResID(list);
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit partial replay of %llu at %u, using %llu", cmdIds[c], eid, partial);
|
||||
#endif
|
||||
trimmedCmdIds.push_back(partial);
|
||||
@@ -321,7 +321,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
}
|
||||
else if(m_Cmd.m_LastEventID >= end)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit full replay %llu", cmdIds[c]);
|
||||
#endif
|
||||
trimmedCmdIds.push_back(cmdIds[c]);
|
||||
@@ -329,7 +329,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue not submitting %llu", cmdIds[c]);
|
||||
#endif
|
||||
}
|
||||
@@ -341,7 +341,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
|
||||
RDCASSERT(trimmedCmds.size() > 0);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
for(size_t i = 0; i < trimmedCmds.size(); i++)
|
||||
{
|
||||
real->ExecuteCommandLists(1, &trimmedCmds[i]);
|
||||
@@ -359,7 +359,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit full replay %u >= %u", m_Cmd.m_LastEventID, m_Cmd.m_RootEventID);
|
||||
#endif
|
||||
|
||||
@@ -367,7 +367,7 @@ bool WrappedID3D12CommandQueue::Serialise_ExecuteCommandLists(UINT NumCommandLis
|
||||
for(uint32_t i = 0; i < numCmds; i++)
|
||||
unwrapped[i] = Unwrap(cmds[i]);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
for(UINT i = 0; i < numCmds; i++)
|
||||
{
|
||||
real->ExecuteCommandLists(1, &unwrapped[i]);
|
||||
|
||||
@@ -146,7 +146,7 @@ WrappedID3D12CommandQueue::WrappedID3D12CommandQueue(ID3D12CommandQueue *real,
|
||||
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandQueue), (void **)&m_WrappedDebug.m_pReal);
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -590,7 +590,7 @@ WrappedID3D12GraphicsCommandList::WrappedID3D12GraphicsCommandList(ID3D12Graphic
|
||||
if(m_pReal)
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandList), (void **)&m_WrappedDebug.m_pReal);
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
|
||||
@@ -51,11 +51,11 @@ void MakeShaderReflection(DXBC::DXBCFile *dxbc, ShaderReflection *refl,
|
||||
// uncomment this to cause every internal ExecuteCommandLists to immediately call
|
||||
// FlushLists(), and to only submit one command list at once to narrow
|
||||
// down the cause of device lost errors
|
||||
//#define SINGLE_FLUSH_VALIDATE
|
||||
#define SINGLE_FLUSH_VALIDATE OPTION_OFF
|
||||
|
||||
// uncomment this to get verbose debugging about when/where/why partial command
|
||||
// buffer replay is happening
|
||||
#define VERBOSE_PARTIAL_REPLAY
|
||||
#define VERBOSE_PARTIAL_REPLAY OPTION_ON
|
||||
|
||||
ShaderStageBits ConvertVisibility(D3D12_SHADER_VISIBILITY ShaderVisibility);
|
||||
UINT GetNumSubresources(ID3D12Device *dev, const D3D12_RESOURCE_DESC *desc);
|
||||
|
||||
@@ -1872,7 +1872,7 @@ void D3D12DebugManager::GetBufferData(ID3D12Resource *buffer, uint64_t offset, u
|
||||
length = RDCMIN(length, desc.Width - offset);
|
||||
}
|
||||
|
||||
#ifndef RDC64BIT
|
||||
#if DISABLED(RDOC_X64)
|
||||
if(offset + length > 0xfffffff)
|
||||
{
|
||||
RDCERR("Trying to read back too much data on 32-bit build. Try running on 64-bit.");
|
||||
|
||||
@@ -208,7 +208,7 @@ WrappedID3D12Device::WrappedID3D12Device(ID3D12Device *realDevice, D3D12InitPara
|
||||
m_GPUSyncHandle = NULL;
|
||||
m_GPUSyncCounter = 0;
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -1817,7 +1817,7 @@ Serialiser *WrappedID3D12Device::GetThreadSerialiser()
|
||||
|
||||
// slow path, but rare
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -2158,7 +2158,7 @@ void WrappedID3D12Device::ReadLogInitialisation()
|
||||
SAFE_RELEASE(it->second);
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(auto it = chunkInfos.begin(); it != chunkInfos.end(); ++it)
|
||||
{
|
||||
double dcount = double(it->second.count);
|
||||
@@ -2270,7 +2270,7 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID,
|
||||
cmd.m_Partial[D3D12CommandData::Primary].outsideCmdList = NULL;
|
||||
}
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
FlushLists(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1257,7 +1257,7 @@ void D3D12ResourceManager::Apply_InitialState(ID3D12DeviceChild *live, InitialCo
|
||||
|
||||
list->Close();
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_Device->ExecuteLists();
|
||||
m_Device->FlushLists(true);
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common.h"
|
||||
|
||||
// typed enum so that templates will pick up specialisations
|
||||
// header must be included before the official headers, so we/
|
||||
// separate it out to avoid clang-format sorting them differently
|
||||
@@ -35,7 +37,7 @@
|
||||
#include "official/glcorearb.h"
|
||||
#include "official/glext.h"
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
#include "official/wglext.h"
|
||||
|
||||
struct GLWindowingData
|
||||
@@ -53,7 +55,7 @@ struct GLWindowingData
|
||||
HWND wnd;
|
||||
};
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_LINUX)
|
||||
#elif ENABLED(RDOC_LINUX)
|
||||
// cheeky way to prevent GL/gl.h from being included, as we want to use
|
||||
// glcorearb.h from above
|
||||
#define __gl_h_
|
||||
@@ -75,7 +77,7 @@ struct GLWindowingData
|
||||
GLXDrawable wnd;
|
||||
};
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_APPLE)
|
||||
#elif ENABLED(RDOC_APPLE)
|
||||
|
||||
struct GLWindowingData
|
||||
{
|
||||
@@ -90,7 +92,7 @@ struct GLWindowingData
|
||||
void *wnd;
|
||||
};
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_ANDROID)
|
||||
#elif ENABLED(RDOC_ANDROID)
|
||||
|
||||
#include "EGL/egl.h"
|
||||
#include "EGL/eglext.h"
|
||||
@@ -113,7 +115,7 @@ struct GLWindowingData
|
||||
#endif
|
||||
|
||||
// define stubs so other platforms can define these functions, but empty
|
||||
#if !defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if DISABLED(RDOC_WIN32)
|
||||
typedef void *HANDLE;
|
||||
typedef long BOOL;
|
||||
|
||||
@@ -130,6 +132,10 @@ typedef BOOL(APIENTRYP *PFNWGLDXUNLOCKOBJECTSNVPROC)(HANDLE hDevice, GLint count
|
||||
|
||||
#include "api/replay/renderdoc_replay.h"
|
||||
|
||||
// define this if you e.g. haven't compiled the D3D modules and want to disable
|
||||
// interop capture support.
|
||||
#define RENDERDOC_DX_GL_INTEROP OPTION_ON
|
||||
|
||||
// similar to RDCUNIMPLEMENTED but for things that are hit often so we don't want to fire the
|
||||
// debugbreak.
|
||||
#define GLNOTIMP(...) RDCDEBUG("OpenGL not implemented - " __VA_ARGS__)
|
||||
|
||||
@@ -760,7 +760,7 @@ WrappedOpenGL::WrappedOpenGL(const char *logfile, const GLHookSet &funcs) : m_Re
|
||||
if(m_Real.glDebugMessageCallback)
|
||||
{
|
||||
m_Real.glDebugMessageCallback(&DebugSnoopStatic, this);
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
m_Real.glEnable(eGL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||
#endif
|
||||
}
|
||||
@@ -3102,7 +3102,7 @@ void WrappedOpenGL::ReadLogInitialisation()
|
||||
break;
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(auto it = chunkInfos.begin(); it != chunkInfos.end(); ++it)
|
||||
{
|
||||
double dcount = double(it->second.count);
|
||||
|
||||
@@ -75,7 +75,7 @@ uint64_t GLReplay::MakeOutputWindow(WindowingSystem system, void *data, bool dep
|
||||
|
||||
if(system == eWindowingSystem_Xlib)
|
||||
{
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
XlibWindowData *xlib = (XlibWindowData *)data;
|
||||
|
||||
dpy = xlib->display;
|
||||
@@ -152,10 +152,10 @@ uint64_t GLReplay::MakeOutputWindow(WindowingSystem system, void *data, bool dep
|
||||
attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
|
||||
attribs[i++] = 3;
|
||||
attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
|
||||
#if defined(_RELEASE)
|
||||
attribs[i++] = 0;
|
||||
#else
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
attribs[i++] = GLX_CONTEXT_DEBUG_BIT_ARB;
|
||||
#else
|
||||
attribs[i++] = 0;
|
||||
#endif
|
||||
attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
@@ -306,10 +306,10 @@ ReplayCreateStatus GL_CreateReplayDevice(const char *logfile, IReplayDriver **dr
|
||||
attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
|
||||
attribs[i++] = 3;
|
||||
attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
|
||||
#if defined(_RELEASE)
|
||||
attribs[i++] = 0;
|
||||
#else
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
attribs[i++] = GLX_CONTEXT_DEBUG_BIT_ARB;
|
||||
#else
|
||||
attribs[i++] = 0;
|
||||
#endif
|
||||
attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
|
||||
@@ -169,10 +169,10 @@ uint64_t GLReplay::MakeOutputWindow(WindowingSystem system, void *data, bool dep
|
||||
attribs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB;
|
||||
attribs[i++] = 3;
|
||||
attribs[i++] = WGL_CONTEXT_FLAGS_ARB;
|
||||
#if defined(_RELEASE)
|
||||
attribs[i++] = 0;
|
||||
#else
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
attribs[i++] = WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
#else
|
||||
attribs[i++] = 0;
|
||||
#endif
|
||||
attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
@@ -406,10 +406,10 @@ ReplayCreateStatus GL_CreateReplayDevice(const char *logfile, IReplayDriver **dr
|
||||
attribs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB;
|
||||
attribs[i++] = 3;
|
||||
attribs[i++] = WGL_CONTEXT_FLAGS_ARB;
|
||||
#if defined(_RELEASE)
|
||||
attribs[i++] = 0;
|
||||
#else
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
attribs[i++] = WGL_CONTEXT_DEBUG_BIT_ARB;
|
||||
#else
|
||||
attribs[i++] = 0;
|
||||
#endif
|
||||
attribs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB;
|
||||
attribs[i++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
|
||||
@@ -244,7 +244,7 @@ struct GLResourceRecord : public ResourceRecord
|
||||
|
||||
void VerifyDataType(GLenum target)
|
||||
{
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
if(target == eGL_NONE)
|
||||
return; // target == GL_NONE means ARB_dsa, target was omitted
|
||||
if(datatype == eGL_NONE)
|
||||
|
||||
@@ -1931,7 +1931,7 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
|
||||
// in case of bugs, we readback into this array instead of
|
||||
GLint dummyReadback[32];
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(size_t i = 1; i < ARRAY_COUNT(dummyReadback); i++)
|
||||
dummyReadback[i] = 0x6c7b8a9d;
|
||||
#endif
|
||||
@@ -2191,7 +2191,7 @@ void GetBindpointMapping(const GLHookSet &gl, GLuint curProg, int shadIdx, Shade
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(size_t i = 1; i < ARRAY_COUNT(dummyReadback); i++)
|
||||
if(dummyReadback[i] != 0x6c7b8a9d)
|
||||
RDCERR("Invalid uniform readback - data beyond first element modified!");
|
||||
|
||||
@@ -26,11 +26,7 @@
|
||||
#include "common/common.h"
|
||||
#include "serialise/string_utils.h"
|
||||
|
||||
// define this if you e.g. haven't compiled the D3D modules and want to disable
|
||||
// interop capture support.
|
||||
#define RENDERDOC_DX_GL_INTEROP 1
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32) && RENDERDOC_DX_GL_INTEROP
|
||||
#if ENABLED(RDOC_WIN32) && ENABLED(RENDERDOC_DX_GL_INTEROP)
|
||||
|
||||
struct ID3D11Resource;
|
||||
|
||||
@@ -245,7 +241,7 @@ bool WrappedOpenGL::Serialise_wglDXRegisterObjectNV(GLResource res, GLenum type,
|
||||
if(m_State >= WRITING)
|
||||
{
|
||||
ResourceFormat format;
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32) && RENDERDOC_DX_GL_INTEROP
|
||||
#if ENABLED(RDOC_WIN32) && ENABLED(RENDERDOC_DX_GL_INTEROP)
|
||||
GetDXTextureProperties(dxObject, format, width, height, depth, mips, layers, samples);
|
||||
internalFormat = MakeGLFormat(*this, format);
|
||||
#else
|
||||
|
||||
@@ -2289,7 +2289,7 @@ bool DXBCFile::ExtractOperation(uint32_t *&tokenStream, ASMOperation &retOp)
|
||||
retOp.str += retOp.operands[i].toString();
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
if((uint32_t)(tokenStream - begin) > retOp.length)
|
||||
{
|
||||
RDCERR("Consumed too many tokens for %d!", retOp.operation);
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include "spirv_common.h"
|
||||
#include "common/common.h"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if ENABLED(RDOC_MSVS)
|
||||
#pragma warning(disable : 4481) // nonstandard extension used: override specifier 'override'
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if ENABLED(RDOC_MSVS)
|
||||
#pragma warning(disable : 4481) // nonstandard extension used: override specifier 'override'
|
||||
#endif
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ using std::make_pair;
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if ENABLED(RDOC_MSVS)
|
||||
#pragma warning(disable : 4481) // nonstandard extension used: override specifier 'override'
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,11 +44,15 @@
|
||||
// uncomment this to cause every internal QueueSubmit to immediately call
|
||||
// DeviceWaitIdle(), and to only submit one command buffer at once to narrow
|
||||
// down the cause of device lost errors
|
||||
//#define SINGLE_FLUSH_VALIDATE
|
||||
#define SINGLE_FLUSH_VALIDATE OPTION_OFF
|
||||
|
||||
// uncomment this to get verbose debugging about when/where/why partial command
|
||||
// buffer replay is happening
|
||||
//#define VERBOSE_PARTIAL_REPLAY
|
||||
#define VERBOSE_PARTIAL_REPLAY OPTION_OFF
|
||||
|
||||
// uncomment this to enable validation layers on replay, useful for debugging
|
||||
// problems with new replay code
|
||||
#define FORCE_VALIDATION_LAYERS OPTION_OFF
|
||||
|
||||
ResourceFormat MakeResourceFormat(VkFormat fmt);
|
||||
VkFormat MakeVkFormat(ResourceFormat fmt);
|
||||
|
||||
@@ -235,7 +235,7 @@ void VkInitParams::Set(const VkInstanceCreateInfo *pCreateInfo, ResourceId inst)
|
||||
|
||||
WrappedVulkan::WrappedVulkan(const char *logFilename) : m_RenderState(&m_CreationInfo)
|
||||
{
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -424,7 +424,7 @@ void WrappedVulkan::SubmitCmds()
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
}
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
FlushQ();
|
||||
#endif
|
||||
|
||||
@@ -487,7 +487,7 @@ void WrappedVulkan::FlushQ()
|
||||
ObjDisp(m_Queue)->QueueWaitIdle(Unwrap(m_Queue));
|
||||
}
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
{
|
||||
ObjDisp(m_Queue)->DeviceWaitIdle(Unwrap(m_Device));
|
||||
VkResult vkr = ObjDisp(m_Queue)->DeviceWaitIdle(Unwrap(m_Device));
|
||||
@@ -624,7 +624,7 @@ Serialiser *WrappedVulkan::GetThreadSerialiser()
|
||||
|
||||
// slow path, but rare
|
||||
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
const bool debugSerialiser = false;
|
||||
#else
|
||||
const bool debugSerialiser = true;
|
||||
@@ -889,7 +889,7 @@ bool WrappedVulkan::Serialise_BeginCaptureFrame(bool applyInitialState)
|
||||
VkCommandBufferBeginInfo beginInfo = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, NULL,
|
||||
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
for(size_t i = 0; i < imgBarriers.size(); i++)
|
||||
{
|
||||
VkCommandBuffer cmd = GetNextCmd();
|
||||
@@ -1489,7 +1489,7 @@ void WrappedVulkan::ReadLogInitialisation()
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
for(auto it = chunkInfos.begin(); it != chunkInfos.end(); ++it)
|
||||
{
|
||||
double dcount = double(it->second.count);
|
||||
@@ -1713,7 +1713,7 @@ void WrappedVulkan::ApplyInitialContents()
|
||||
vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2246,7 +2246,7 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay
|
||||
m_Partial[Primary].outsideCmdBuffer = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ vector<CounterResult> VulkanReplay::FetchCounters(const vector<uint32_t> &counte
|
||||
vkr = ObjDisp(dev)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1000,7 +1000,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
attState.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||
attState.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
|
||||
VkShaderModule ms2arrayModule, array2msModule;
|
||||
VkShaderModule ms2arrayModule = VK_NULL_HANDLE, array2msModule = VK_NULL_HANDLE;
|
||||
|
||||
for(size_t i = 0; i < 2; i++)
|
||||
{
|
||||
@@ -2944,7 +2944,7 @@ void VulkanDebugManager::CreateCustomShaderTex(uint32_t width, uint32_t height,
|
||||
vkr = ObjDisp(dev)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -4250,7 +4250,7 @@ uint32_t VulkanDebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg
|
||||
VkResult vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -4401,7 +4401,7 @@ void VulkanDebugManager::GetBufferData(ResourceId buff, uint64_t offset, uint64_
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -5956,7 +5956,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, TextureDisplayOve
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -6188,7 +6188,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, TextureDisplayOve
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -6300,7 +6300,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, TextureDisplayOve
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -6692,7 +6692,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, TextureDisplayOve
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
// layer includes
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
// undefined clashing windows #defines
|
||||
#undef CreateEvent
|
||||
#undef CreateSemaphore
|
||||
|
||||
@@ -2141,7 +2141,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live,
|
||||
vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
return;
|
||||
@@ -2215,7 +2215,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live,
|
||||
vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2275,7 +2275,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live,
|
||||
vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2414,7 +2414,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live,
|
||||
vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2443,7 +2443,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live,
|
||||
vkr = ObjDisp(cmd)->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *d
|
||||
{
|
||||
m_WindowSystem = system;
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
if(system == eWindowingSystem_Xlib)
|
||||
{
|
||||
XlibWindowData *xdata = (XlibWindowData *)data;
|
||||
@@ -41,7 +41,7 @@ void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *d
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#if ENABLED(RDOC_XCB)
|
||||
if(system == eWindowingSystem_XCB)
|
||||
{
|
||||
XCBWindowData *xdata = (XCBWindowData *)data;
|
||||
@@ -56,7 +56,7 @@ void VulkanReplay::OutputWindow::SetWindowHandle(WindowingSystem system, void *d
|
||||
|
||||
void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst)
|
||||
{
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
if(m_WindowSystem == eWindowingSystem_Xlib)
|
||||
{
|
||||
VkXlibSurfaceCreateInfoKHR createInfo;
|
||||
@@ -74,7 +74,7 @@ void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#if ENABLED(RDOC_XCB)
|
||||
if(m_WindowSystem == eWindowingSystem_XCB)
|
||||
{
|
||||
VkXcbSurfaceCreateInfoKHR createInfo;
|
||||
@@ -102,7 +102,7 @@ void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h
|
||||
|
||||
OutputWindow &outw = m_OutputWindows[id];
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
if(outw.m_WindowSystem == eWindowingSystem_Xlib)
|
||||
{
|
||||
XWindowAttributes attr = {};
|
||||
@@ -115,7 +115,7 @@ void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#if ENABLED(RDOC_XCB)
|
||||
if(outw.m_WindowSystem == eWindowingSystem_XCB)
|
||||
{
|
||||
xcb_get_geometry_cookie_t geomCookie =
|
||||
|
||||
@@ -1426,7 +1426,7 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
|
||||
|
||||
vt->EndCommandBuffer(Unwrap(cmd));
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -1567,7 +1567,7 @@ void VulkanReplay::RenderCheckerboard(Vec3f light, Vec3f dark)
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -1668,7 +1668,7 @@ void VulkanReplay::RenderHighlightBox(float w, float h, float scale)
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2186,7 +2186,7 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector<MeshFormat> &second
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
@@ -2752,7 +2752,7 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector<MeshFormat> &second
|
||||
vkr = vt->EndCommandBuffer(Unwrap(cmd));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2891,7 +2891,7 @@ void VulkanReplay::BindOutputWindow(uint64_t id, bool depth)
|
||||
|
||||
vt->EndCommandBuffer(Unwrap(cmd));
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2941,7 +2941,7 @@ void VulkanReplay::ClearOutputWindowColour(uint64_t id, float col[4])
|
||||
|
||||
vt->EndCommandBuffer(Unwrap(cmd));
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -2994,7 +2994,7 @@ void VulkanReplay::ClearOutputWindowDepth(uint64_t id, float depth, uint8_t sten
|
||||
|
||||
vt->EndCommandBuffer(Unwrap(cmd));
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
}
|
||||
@@ -3043,7 +3043,7 @@ void VulkanReplay::FlipOutputWindow(uint64_t id)
|
||||
},
|
||||
};
|
||||
|
||||
#if MSAA_MESH_VIEW
|
||||
#if ENABLED(MSAA_MESH_VIEW)
|
||||
VkImageResolve resolve = {
|
||||
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, {0, 0, 0},
|
||||
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, {0, 0, 0},
|
||||
@@ -4704,7 +4704,7 @@ byte *VulkanReplay::GetTextureData(ResourceId tex, uint32_t arrayIdx, uint32_t m
|
||||
// ordering
|
||||
vt->EndCommandBuffer(Unwrap(cmd));
|
||||
|
||||
#if defined(SINGLE_FLUSH_VALIDATE)
|
||||
#if ENABLED(SINGLE_FLUSH_VALIDATE)
|
||||
m_pDriver->SubmitCmds();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -30,20 +30,20 @@
|
||||
#include "vk_common.h"
|
||||
#include "vk_info.h"
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
|
||||
#include <windows.h>
|
||||
#define WINDOW_HANDLE_DECL HWND wnd;
|
||||
#define WINDOW_HANDLE_INIT wnd = NULL;
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_ANDROID)
|
||||
#elif ENABLED(RDOC_ANDROID)
|
||||
|
||||
#define WINDOW_HANDLE_DECL ANativeWindow *wnd;
|
||||
#define WINDOW_HANDLE_INIT wnd = NULL;
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_LINUX)
|
||||
#elif ENABLED(RDOC_LINUX)
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
|
||||
#define WINDOW_HANDLE_XLIB \
|
||||
struct \
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#if ENABLED(RDOC_XCB)
|
||||
|
||||
#define WINDOW_HANDLE_XCB \
|
||||
struct \
|
||||
@@ -107,9 +107,9 @@ using std::map;
|
||||
msgprinted = true; \
|
||||
} while((void)0, 0)
|
||||
|
||||
#define MSAA_MESH_VIEW 1
|
||||
#define MSAA_MESH_VIEW OPTION_ON
|
||||
|
||||
#if MSAA_MESH_VIEW
|
||||
#if ENABLED(MSAA_MESH_VIEW)
|
||||
#define VULKAN_MESH_VIEW_SAMPLES VK_SAMPLE_COUNT_4_BIT
|
||||
#else
|
||||
#define VULKAN_MESH_VIEW_SAMPLES VK_SAMPLE_COUNT_1_BIT
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "vk_resources.h"
|
||||
|
||||
// this should be in the vulkan definition header
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
#undef VK_LAYER_EXPORT
|
||||
#define VK_LAYER_EXPORT extern "C" __declspec(dllexport)
|
||||
#endif
|
||||
@@ -176,7 +176,7 @@ void VKAPI_CALL hooked_vkDestroyInstance(VkInstance instance, const VkAllocation
|
||||
|
||||
// Layer Intercepts
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32) && !defined(RDC64BIT)
|
||||
#if ENABLED(RDOC_WIN32) && DISABLED(RDOC_X64)
|
||||
|
||||
// Win32 __stdcall will still mangle even with extern "C", set up aliases
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
// to be exported with the precise canonical names. We just forward them to the
|
||||
// layer-named functions
|
||||
|
||||
#if !defined(RENDERDOC_PLATFORM_ANDROID)
|
||||
#if DISABLED(RDOC_ANDROID)
|
||||
#error "This file should only be compiled on android!"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ bool WrappedVulkan::Serialise_vkBeginCommandBuffer(Serialiser *localSerialiser,
|
||||
{
|
||||
if(*it <= m_LastEventID && m_LastEventID < (*it + length))
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("vkBegin - partial detected %u < %u < %u, %llu -> %llu", *it, m_LastEventID,
|
||||
*it + length, cmdId, bakeId);
|
||||
#endif
|
||||
@@ -678,7 +678,7 @@ bool WrappedVulkan::Serialise_vkEndCommandBuffer(Serialiser *localSerialiser,
|
||||
if(ShouldRerecordCmd(cmdid))
|
||||
{
|
||||
commandBuffer = RerecordCmdBuf(cmdid);
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Ending partial command buffer for %llu baked to %llu", cmdid, bakeId);
|
||||
#endif
|
||||
|
||||
@@ -2432,13 +2432,13 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
}
|
||||
else if(m_LastEventID <= startEID)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands no replay %u == %u", m_LastEventID, startEID);
|
||||
#endif
|
||||
}
|
||||
else if(m_DrawcallCallback && m_DrawcallCallback->RecordAllCmds())
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands re-recording from %u", startEID);
|
||||
#endif
|
||||
|
||||
@@ -2448,7 +2448,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
{
|
||||
VkCommandBuffer cmd = RerecordCmdBuf(cmdids[c]);
|
||||
ResourceId rerecord = GetResID(cmd);
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands fully re-recorded replay of %llu, using %llu", cmdids[c],
|
||||
rerecord);
|
||||
#endif
|
||||
@@ -2463,7 +2463,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
else if(m_LastEventID > startEID &&
|
||||
m_LastEventID < parentCmdBufInfo.curEventID + m_Partial[Primary].baseEvent)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands partial replay %u < %u", m_LastEventID,
|
||||
parentCmdBufInfo.curEventID + m_Partial[Primary].baseEvent);
|
||||
#endif
|
||||
@@ -2484,7 +2484,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
if(eid == m_Partial[Secondary].baseEvent)
|
||||
{
|
||||
ResourceId partial = GetResID(RerecordCmdBuf(cmdids[c], Secondary));
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands partial replay of %llu at %u, using %llu", cmdids[c], eid,
|
||||
partial);
|
||||
#endif
|
||||
@@ -2493,7 +2493,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
}
|
||||
else if(m_LastEventID >= end)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands full replay %llu", cmdids[c]);
|
||||
#endif
|
||||
trimmedCmdIds.push_back(cmdids[c]);
|
||||
@@ -2502,7 +2502,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("not executing %llu", cmdids[c]);
|
||||
#endif
|
||||
}
|
||||
@@ -2525,7 +2525,7 @@ bool WrappedVulkan::Serialise_vkCmdExecuteCommands(Serialiser *localSerialiser,
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("ExecuteCommands full replay %u >= %u", m_LastEventID,
|
||||
parentCmdBufInfo.curEventID + m_Partial[Primary].baseEvent);
|
||||
#endif
|
||||
|
||||
@@ -47,8 +47,6 @@ void InitInstanceTable(VkInstance inst, PFN_vkGetInstanceProcAddr gpa);
|
||||
// and
|
||||
// instance are destroyed. We only clean up after our own objects.
|
||||
|
||||
//#define FORCE_VALIDATION_LAYERS
|
||||
|
||||
static void StripUnwantedLayers(vector<string> &Layers)
|
||||
{
|
||||
for(auto it = Layers.begin(); it != Layers.end();)
|
||||
@@ -95,7 +93,7 @@ ReplayCreateStatus WrappedVulkan::Initialise(VkInitParams ¶ms)
|
||||
// PORTABILITY verify that layers/extensions are available
|
||||
StripUnwantedLayers(params.Layers);
|
||||
|
||||
#if defined(FORCE_VALIDATION_LAYERS)
|
||||
#if ENABLED(FORCE_VALIDATION_LAYERS)
|
||||
params.Layers.push_back("VK_LAYER_LUNARG_standard_validation");
|
||||
|
||||
params.Extensions.push_back("VK_EXT_debug_report");
|
||||
@@ -790,7 +788,7 @@ bool WrappedVulkan::Serialise_vkCreateDevice(Serialiser *localSerialiser,
|
||||
|
||||
AddRequiredExtensions(false, Extensions, supportedExtensions);
|
||||
|
||||
#if defined(FORCE_VALIDATION_LAYERS)
|
||||
#if ENABLED(FORCE_VALIDATION_LAYERS)
|
||||
Layers.push_back("VK_LAYER_LUNARG_standard_validation");
|
||||
#endif
|
||||
|
||||
|
||||
@@ -283,13 +283,13 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
}
|
||||
else if(m_LastEventID <= startEID)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit no replay %u == %u", m_LastEventID, startEID);
|
||||
#endif
|
||||
}
|
||||
else if(m_DrawcallCallback && m_DrawcallCallback->RecordAllCmds())
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit re-recording from %u", m_RootEventID);
|
||||
#endif
|
||||
|
||||
@@ -299,7 +299,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
{
|
||||
VkCommandBuffer cmd = RerecordCmdBuf(cmdIds[c]);
|
||||
ResourceId rerecord = GetResID(cmd);
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit fully re-recorded replay of %llu, using %llu", cmdIds[c], rerecord);
|
||||
#endif
|
||||
rerecordedCmds.push_back(Unwrap(cmd));
|
||||
@@ -316,7 +316,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
}
|
||||
else if(m_LastEventID > startEID && m_LastEventID < m_RootEventID)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit partial replay %u < %u", m_LastEventID, m_RootEventID);
|
||||
#endif
|
||||
|
||||
@@ -336,7 +336,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
if(eid == m_Partial[Primary].baseEvent)
|
||||
{
|
||||
ResourceId partial = GetResID(RerecordCmdBuf(cmdIds[c], Primary));
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit partial replay of %llu at %u, using %llu", cmdIds[c], eid, partial);
|
||||
#endif
|
||||
trimmedCmdIds.push_back(partial);
|
||||
@@ -344,7 +344,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
}
|
||||
else if(m_LastEventID >= end)
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit full replay %llu", cmdIds[c]);
|
||||
#endif
|
||||
trimmedCmdIds.push_back(cmdIds[c]);
|
||||
@@ -353,7 +353,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue not submitting %llu", cmdIds[c]);
|
||||
#endif
|
||||
}
|
||||
@@ -379,7 +379,7 @@ bool WrappedVulkan::Serialise_vkQueueSubmit(Serialiser *localSerialiser, VkQueue
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef VERBOSE_PARTIAL_REPLAY
|
||||
#if ENABLED(VERBOSE_PARTIAL_REPLAY)
|
||||
RDCDEBUG("Queue Submit full replay %u >= %u", m_LastEventID, m_RootEventID);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ using std::map;
|
||||
|
||||
// include os-specific hooking mechanisms here
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
|
||||
#include "os/win32/win32_hook.h"
|
||||
|
||||
@@ -59,7 +59,7 @@ private:
|
||||
#define HOOKS_END() Win32_IAT_EndHooks()
|
||||
#define HOOKS_REMOVE() Win32_IAT_RemoveHooks()
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_POSIX)
|
||||
#elif ENABLED(RDOC_POSIX)
|
||||
|
||||
#include "os/posix/posix_hook.h"
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ string MakeMachineIdentString(uint64_t ident);
|
||||
namespace Bits
|
||||
{
|
||||
inline uint32_t CountLeadingZeroes(uint32_t value);
|
||||
#if RDC64BIT
|
||||
#if ENABLED(RDOC_X64)
|
||||
inline uint64_t CountLeadingZeroes(uint64_t value);
|
||||
#endif
|
||||
};
|
||||
@@ -442,9 +442,9 @@ inline uint64_t CountLeadingZeroes(uint64_t value);
|
||||
// OS_DEBUG_BREAK() - instruction that debugbreaks the debugger - define instead of function to
|
||||
// preserve callstacks
|
||||
|
||||
#if defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
#include "win32/win32_specific.h"
|
||||
#elif defined(RENDERDOC_PLATFORM_POSIX)
|
||||
#elif ENABLED(RDOC_POSIX)
|
||||
#include "posix/posix_specific.h"
|
||||
#else
|
||||
#error Undefined Platform!
|
||||
|
||||
@@ -119,7 +119,7 @@ uint64_t GetMachineIdent()
|
||||
ret |= MachineIdent_Arch_x86;
|
||||
#endif
|
||||
|
||||
#if defined(RDC64BIT)
|
||||
#if ENABLED(RDOC_X64)
|
||||
ret |= MachineIdent_64bit;
|
||||
#else
|
||||
ret |= MachineIdent_32bit;
|
||||
|
||||
@@ -143,7 +143,7 @@ void CacheDebuggerPresent()
|
||||
bool OSUtility::DebuggerPresent()
|
||||
{
|
||||
// apple requires that this only be called in debug builds
|
||||
#if defined(RELEASE)
|
||||
#if ENABLED(RDOC_RELEASE)
|
||||
return false;
|
||||
#else
|
||||
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()};
|
||||
|
||||
@@ -22,15 +22,6 @@
|
||||
* THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <iconv.h>
|
||||
#include <pwd.h>
|
||||
@@ -45,6 +36,15 @@
|
||||
#include "os/os_specific.h"
|
||||
#include "serialise/string_utils.h"
|
||||
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#endif
|
||||
|
||||
#if ENABLED(RDOC_XCB)
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#endif
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace Keyboard
|
||||
@@ -55,14 +55,14 @@ void Init()
|
||||
|
||||
bool PlatformHasKeyInput()
|
||||
{
|
||||
#if defined(RENDERDOC_WINDOWING_XCB) || defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XCB) || ENABLED(RDOC_XLIB)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
|
||||
Display *CurrentXDisplay = NULL;
|
||||
|
||||
@@ -135,7 +135,7 @@ bool GetXlibKeyState(int key)
|
||||
|
||||
#else
|
||||
|
||||
// if RENDERDOC_WINDOWING_XLIB is not defined
|
||||
// if RENDERDOC_WINDOWING_XLIB is not enabled
|
||||
|
||||
bool GetXlibKeyState(int key)
|
||||
{
|
||||
@@ -144,7 +144,7 @@ bool GetXlibKeyState(int key)
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#if ENABLED(RDOC_XCB)
|
||||
|
||||
xcb_connection_t *connection;
|
||||
xcb_key_symbols_t *symbols;
|
||||
@@ -227,7 +227,7 @@ bool GetXCBKeyState(int key)
|
||||
|
||||
#else
|
||||
|
||||
// if RENDERDOC_WINDOWING_XCB is not defined
|
||||
// if RENDERDOC_WINDOWING_XCB is not enabled
|
||||
|
||||
bool GetXCBKeyState(int key)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ string Wide2UTF8(const std::wstring &s)
|
||||
|
||||
if(ret == (size_t)-1)
|
||||
{
|
||||
#if !defined(_RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
RDCWARN("Failed to convert wstring");
|
||||
#endif
|
||||
return "";
|
||||
@@ -357,7 +357,7 @@ uint64_t GetMachineIdent()
|
||||
ret |= MachineIdent_Arch_x86;
|
||||
#endif
|
||||
|
||||
#if defined(RDC64BIT)
|
||||
#if ENABLED(RDOC_X64)
|
||||
ret |= MachineIdent_64bit;
|
||||
#else
|
||||
ret |= MachineIdent_32bit;
|
||||
|
||||
@@ -67,7 +67,7 @@ inline uint32_t CountLeadingZeroes(uint32_t value)
|
||||
return __builtin_clz(value);
|
||||
}
|
||||
|
||||
#if RDC64BIT
|
||||
#if ENABLED(RDOC_X64)
|
||||
inline uint64_t CountLeadingZeroes(uint64_t value)
|
||||
{
|
||||
return __builtin_clzl(value);
|
||||
|
||||
@@ -169,7 +169,7 @@ static bool InitDbgHelp()
|
||||
*slash = 0;
|
||||
}
|
||||
|
||||
#if defined(WIN64)
|
||||
#if ENABLED(RDOC_X64)
|
||||
wcscat_s(path, L"/pdblocate/x64/dbghelp.dll");
|
||||
#else
|
||||
wcscat_s(path, L"/pdblocate/x86/dbghelp.dll");
|
||||
|
||||
@@ -267,7 +267,7 @@ struct CachedHookData
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef WIN64
|
||||
#if ENABLED(RDOC_X64)
|
||||
if(IMAGE_SNAP_BY_ORDINAL64(origFirst->u1.AddressOfData))
|
||||
#else
|
||||
if(IMAGE_SNAP_BY_ORDINAL32(origFirst->u1.AddressOfData))
|
||||
|
||||
@@ -535,7 +535,7 @@ uint32_t Process::InjectIntoProcess(uint32_t pid, EnvironmentModification *env,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(WIN64)
|
||||
#if DISABLED(RDOC_X64)
|
||||
BOOL selfWow64 = FALSE;
|
||||
|
||||
HANDLE hSelfProcess = GetCurrentProcess();
|
||||
@@ -903,7 +903,7 @@ void Process::StartGlobalHook(const char *pathmatch, const char *logfile, const
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
|
||||
#if defined(WIN64)
|
||||
#if ENABLED(RDOC_X64)
|
||||
*slash = 0;
|
||||
|
||||
wcscat_s(renderdocPath, L"\\x86\\renderdoccmd.exe");
|
||||
|
||||
@@ -73,7 +73,7 @@ inline uint32_t CountLeadingZeroes(uint32_t value)
|
||||
return (result == TRUE) ? (index ^ 31) : 32;
|
||||
}
|
||||
|
||||
#if RDC64BIT
|
||||
#if ENABLED(RDOC_X64)
|
||||
inline uint64_t CountLeadingZeroes(uint64_t value)
|
||||
{
|
||||
DWORD index;
|
||||
|
||||
@@ -594,7 +594,7 @@ string Wide2UTF8(const wstring &s)
|
||||
|
||||
if(res == 0)
|
||||
{
|
||||
#if !defined(_RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
RDCWARN("Failed to convert wstring"); // can't pass string through as this would infinitely
|
||||
// recurse
|
||||
#endif
|
||||
@@ -621,7 +621,7 @@ wstring UTF82Wide(const string &s)
|
||||
|
||||
if(res == 0)
|
||||
{
|
||||
#if !defined(_RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
RDCWARN("Failed to convert utf-8 string"); // can't pass string through as this would
|
||||
// infinitely recurse
|
||||
#endif
|
||||
@@ -656,7 +656,7 @@ uint64_t GetMachineIdent()
|
||||
ret |= MachineIdent_Arch_x86;
|
||||
#endif
|
||||
|
||||
#if defined(RDC64BIT)
|
||||
#if ENABLED(RDOC_X64)
|
||||
ret |= MachineIdent_64bit;
|
||||
#else
|
||||
ret |= MachineIdent_32bit;
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
|
||||
static uint64_t GetHandle(WindowingSystem system, void *data)
|
||||
{
|
||||
#if defined(RENDERDOC_PLATFORM_LINUX)
|
||||
#if ENABLED(RDOC_LINUX)
|
||||
|
||||
if(system == eWindowingSystem_Xlib)
|
||||
{
|
||||
#if defined(RENDERDOC_WINDOWING_XLIB)
|
||||
#if ENABLED(RDOC_XLIB)
|
||||
return (uint64_t)((XlibWindowData *)data)->window;
|
||||
#else
|
||||
RDCERR("Xlib windowing system data passed in, but support is not compiled in");
|
||||
@@ -43,7 +43,7 @@ static uint64_t GetHandle(WindowingSystem system, void *data)
|
||||
|
||||
if(system == eWindowingSystem_XCB)
|
||||
{
|
||||
#if defined(RENDERDOC_WINDOWING_XCB)
|
||||
#if ENABLED(RDOC_XCB)
|
||||
return (uint64_t)((XCBWindowData *)data)->window;
|
||||
#else
|
||||
RDCERR("XCB windowing system data passed in, but support is not compiled in");
|
||||
@@ -54,12 +54,12 @@ static uint64_t GetHandle(WindowingSystem system, void *data)
|
||||
|
||||
return 0;
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_WIN32)
|
||||
#elif ENABLED(RDOC_WIN32)
|
||||
|
||||
RDCASSERT(system == eWindowingSystem_Win32);
|
||||
return (uint64_t)data; // HWND
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_ANDROID)
|
||||
#elif ENABLED(RDOC_ANDROID)
|
||||
|
||||
RDCASSERT(system == eWindowingSystem_Android);
|
||||
return (uint64_t)data; // ANativeWindow *
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
#include "core/core.h"
|
||||
#include "serialise/string_utils.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning( \
|
||||
disable : 4422) // warning C4422: 'snprintf' : too many arguments passed for format string
|
||||
// false positive as VS is trying to parse renderdoc's custom format strings
|
||||
#if ENABLED(RDOC_MSVS)
|
||||
// warning C4422: 'snprintf' : too many arguments passed for format string
|
||||
// false positive as VS is trying to parse renderdoc's custom format strings
|
||||
#pragma warning(disable : 4422)
|
||||
#endif
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
|
||||
int64_t Chunk::m_LiveChunks = 0;
|
||||
int64_t Chunk::m_TotalMem = 0;
|
||||
@@ -265,7 +265,7 @@ Chunk::Chunk(Serialiser *ser, uint32_t chunkType, bool temporary)
|
||||
|
||||
ser->Rewind();
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
int64_t newval = Atomic::Inc64(&m_LiveChunks);
|
||||
Atomic::ExchAdd64(&m_TotalMem, m_Length);
|
||||
|
||||
@@ -295,7 +295,7 @@ Chunk *Chunk::Duplicate()
|
||||
|
||||
memcpy(ret->m_Data, m_Data, m_Length);
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
int64_t newval = Atomic::Inc64(&m_LiveChunks);
|
||||
Atomic::ExchAdd64(&m_TotalMem, m_Length);
|
||||
|
||||
@@ -313,7 +313,7 @@ Chunk *Chunk::Duplicate()
|
||||
|
||||
Chunk::~Chunk()
|
||||
{
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
Atomic::Dec64(&m_LiveChunks);
|
||||
Atomic::ExchAdd64(&m_TotalMem, -int64_t(m_Length));
|
||||
#endif
|
||||
@@ -1979,7 +1979,7 @@ string ToStrHelper<false, int64_t>::Get(const int64_t &el)
|
||||
// platforms size_t is typedef'd in such a way that the uint32_t or
|
||||
// uint64_t specialisation will kick in. On apple, we need a
|
||||
// specific size_t overload
|
||||
#if defined(RENDERDOC_PLATFORM_APPLE)
|
||||
#if ENABLED(RDOC_APPLE)
|
||||
template <>
|
||||
string ToStrHelper<false, size_t>::Get(const size_t &el)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
uint32_t GetChunkType() { return m_ChunkType; }
|
||||
bool IsAligned() { return m_AlignedData; }
|
||||
bool IsTemporary() { return m_Temporary; }
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
static uint64_t NumLiveChunks() { return m_LiveChunks; }
|
||||
static uint64_t TotalMem() { return m_TotalMem; }
|
||||
#else
|
||||
@@ -132,7 +132,7 @@ private:
|
||||
byte *m_Data;
|
||||
string m_DebugStr;
|
||||
|
||||
#if !defined(RELEASE)
|
||||
#if ENABLED(RDOC_DEVEL)
|
||||
static int64_t m_LiveChunks, m_MaxChunks, m_TotalMem;
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user