diff --git a/renderdoc/android/android.cpp b/renderdoc/android/android.cpp index 264320b69..cde19d6fb 100644 --- a/renderdoc/android/android.cpp +++ b/renderdoc/android/android.cpp @@ -176,7 +176,7 @@ rdcstr GetProcessNameForActivity(const rdcstr &deviceID, const rdcstr &packageNa int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) { - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Getting PID from device %s for process '%s'", deviceID.c_str(), processName.c_str()); } @@ -192,7 +192,7 @@ int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) output.trim(); int space = output.find_first_of("\t "); - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Output from ps -A: '%s'", output.c_str()); } @@ -207,13 +207,13 @@ int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) output.trim(); space = output.find_first_of("\t "); - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Output from ps: '%s'", output.c_str()); } } - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Final output is '%s' and first space is at char %d", output.c_str(), space); } @@ -221,7 +221,7 @@ int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) // if we still didn't get a response, sleep and try again next time if(output.empty() || output.find(processName) == -1 || space == -1) { - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Didn't get valid PID line, waiting"); } @@ -234,7 +234,7 @@ int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) while(*pid == ' ' || *pid == '\t') pid++; - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Expecting PID starting at '%s'", pid); } @@ -245,14 +245,14 @@ int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) *end = 0; - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Truncated PID string: '%s'", pid); } int pidInt = atoi(pid); - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Parsed integer PID: %d", pidInt); } @@ -260,7 +260,7 @@ int GetCurrentPID(const rdcstr &deviceID, const rdcstr &processName) return pidInt; } - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Failed to get a PID after several retries"); } @@ -1102,7 +1102,7 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const char *a, const char *w rdcstr processName = Android::GetProcessNameForActivity(m_deviceID, packageName, activityName); - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Launching package '%s' with activity '%s' and process name '%s'", packageName.c_str(), activityName.c_str(), processName.c_str()); @@ -1178,7 +1178,7 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const char *a, const char *w "/lib/*/" RENDERDOC_ANDROID_LIBRARY) .strStdout.trimmed(); - if(Android_Debug_ProcessLaunch) + if(Android_Debug_ProcessLaunch()) { RDCLOG("Checking for existing library, found '%s'", RDCLib.c_str()); } @@ -1262,7 +1262,7 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const char *a, const char *w ret.status = ReplayStatus::InjectionFailed; - uint32_t elapsed = 0, timeout = 1000 * RDCMAX(5U, Android_MaxConnectTimeout); + uint32_t elapsed = 0, timeout = 1000 * RDCMAX(5U, Android_MaxConnectTimeout()); while(elapsed < timeout) { // Check if the target app has started yet and we can connect to it. diff --git a/renderdoc/android/android_tools.cpp b/renderdoc/android/android_tools.cpp index 7c62cd114..2e2a0e133 100644 --- a/renderdoc/android/android_tools.cpp +++ b/renderdoc/android/android_tools.cpp @@ -187,8 +187,8 @@ rdcstr getToolPath(ToolDir subdir, const rdcstr &toolname, bool checkExist) // its client-server setup, so if we run our bundled adb that might be newer than the user's, they // will then get fighting back and forth when trying to run their own. - rdcstr sdk = Android_SDKDirPath; - rdcstr jdk = Android_JDKDirPath; + rdcstr sdk = Android_SDKDirPath(); + rdcstr jdk = Android_JDKDirPath(); ToolPathCache &cache = getCache(); diff --git a/renderdoc/core/remote_server.cpp b/renderdoc/core/remote_server.cpp index 80d790830..59c868b07 100644 --- a/renderdoc/core/remote_server.cpp +++ b/renderdoc/core/remote_server.cpp @@ -217,7 +217,7 @@ static void ActiveRemoteClientThread(ClientThread *threadData, Network::Socket *&client = threadData->socket; - client->SetTimeout(RemoteServer_TimeoutMS); + client->SetTimeout(RemoteServer_TimeoutMS()); uint32_t ip = client->GetRemoteIP(); @@ -277,7 +277,7 @@ static void ActiveRemoteClientThread(ClientThread *threadData, WriteSerialiser writer(new StreamWriter(client, Ownership::Nothing), Ownership::Stream); ReadSerialiser reader(new StreamReader(client, Ownership::Nothing), Ownership::Stream); - if(RemoteServer_DebugLogging) + if(RemoteServer_DebugLogging()) { reader.ConfigureStructuredExport(&GetRemoteServerChunkName, false); writer.ConfigureStructuredExport(&GetRemoteServerChunkName, false); @@ -1178,7 +1178,7 @@ RENDERDOC_CreateRemoteServerConnection(const char *URL, IRemoteServer **rend) uint32_t version = RemoteServerProtocolVersion; - sock->SetTimeout(RemoteServer_TimeoutMS); + sock->SetTimeout(RemoteServer_TimeoutMS()); { WriteSerialiser ser(new StreamWriter(sock, Ownership::Nothing), Ownership::Stream); @@ -1238,7 +1238,7 @@ RemoteServer::RemoteServer(Network::Socket *sock, const rdcstr &deviceID) reader = new ReadSerialiser(new StreamReader(sock, Ownership::Nothing), Ownership::Stream); writer = new WriteSerialiser(new StreamWriter(sock, Ownership::Nothing), Ownership::Stream); - if(RemoteServer_DebugLogging) + if(RemoteServer_DebugLogging()) { reader->ConfigureStructuredExport(&GetRemoteServerChunkName, false); writer->ConfigureStructuredExport(&GetRemoteServerChunkName, false); diff --git a/renderdoc/core/settings.h b/renderdoc/core/settings.h index c065a3bc9..54dfa36c4 100644 --- a/renderdoc/core/settings.h +++ b/renderdoc/core/settings.h @@ -58,8 +58,7 @@ CONFIG_SUPPORT_TYPE(rdcarray); #define RDOC_CONFIG(type, name, defaultValue, description) \ static ConfigVarRegistration CONCAT(config, __LINE__)( \ STRING_LITERAL(STRINGIZE(name)), defaultValue, false, STRING_LITERAL(description)); \ - static const type &name = CONCAT(config, __LINE__).value(); - + static const type &name() { return CONCAT(config, __LINE__).value(); } // debug configs get set to constants in official stable builds, they will remain configurable // in nightly builds and of course in development builds #if RENDERDOC_STABLE_BUILD @@ -67,13 +66,11 @@ CONFIG_SUPPORT_TYPE(rdcarray); #define RDOC_DEBUG_CONFIG(type, name, defaultValue, description) \ static ConfigVarRegistration CONCAT(config, __LINE__)( \ STRING_LITERAL(STRINGIZE(name)), defaultValue, true, STRING_LITERAL(description)); \ - static const type name = defaultValue; - + static constexpr type name() { return defaultValue; } #else #define RDOC_DEBUG_CONFIG(type, name, defaultValue, description) \ ConfigVarRegistration CONCAT(config, __LINE__)( \ STRING_LITERAL(STRINGIZE(name)), defaultValue, true, STRING_LITERAL(description)); \ - static const type &name = CONCAT(config, __LINE__).value(); - + static const type &name() { return CONCAT(config, __LINE__).value(); } #endif diff --git a/renderdoc/driver/d3d11/d3d11_device.cpp b/renderdoc/driver/d3d11/d3d11_device.cpp index 3edf669c3..e1b1309bd 100644 --- a/renderdoc/driver/d3d11/d3d11_device.cpp +++ b/renderdoc/driver/d3d11/d3d11_device.cpp @@ -790,9 +790,9 @@ rdcstr WrappedID3D11Device::GetChunkName(uint32_t idx) return ToStr((D3D11Chunk)idx); } -const rdcarray *WrappedID3D11Device::GetShaderDebugInfoSearchPaths() +const rdcarray &WrappedID3D11Device::GetShaderDebugInfoSearchPaths() { - return &DXBC_Debug_SearchDirPaths; + return DXBC_Debug_SearchDirPaths(); } void WrappedID3D11Device::AddDebugMessage(MessageCategory c, MessageSeverity sv, MessageSource src, diff --git a/renderdoc/driver/d3d11/d3d11_device.h b/renderdoc/driver/d3d11/d3d11_device.h index 387172edd..6be154fde 100644 --- a/renderdoc/driver/d3d11/d3d11_device.h +++ b/renderdoc/driver/d3d11/d3d11_device.h @@ -454,7 +454,7 @@ public: return m_LayoutDescs[layout]; } - const rdcarray *GetShaderDebugInfoSearchPaths(); + const rdcarray &GetShaderDebugInfoSearchPaths(); template bool Serialise_CaptureScope(SerialiserType &ser); diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index fc1e33ef0..940a64f22 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -174,7 +174,7 @@ void D3D11Replay::CreateResources(IDXGIFactory *factory) m_pDevice->GetShaderCache()->SetCaching(false); - if(!m_Proxy && D3D11_HardwareCounters) + if(!m_Proxy && D3D11_HardwareCounters()) { AMDCounters *countersAMD = NULL; NVCounters *countersNV = NULL; diff --git a/renderdoc/driver/d3d11/d3d11_resources.h b/renderdoc/driver/d3d11/d3d11_resources.h index 0f59c4834..6e3d7cb79 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.h +++ b/renderdoc/driver/d3d11/d3d11_resources.h @@ -919,7 +919,7 @@ public: { m_ID = id; m_Bytecode.assign(code, codeLen); - m_DebugInfoSearchPaths = device->GetShaderDebugInfoSearchPaths(); + m_DebugInfoSearchPaths = &device->GetShaderDebugInfoSearchPaths(); m_DXBCFile = NULL; } ~ShaderEntry() diff --git a/renderdoc/driver/d3d12/d3d12_replay.cpp b/renderdoc/driver/d3d12/d3d12_replay.cpp index 1cc348bb5..01ae62bab 100644 --- a/renderdoc/driver/d3d12/d3d12_replay.cpp +++ b/renderdoc/driver/d3d12/d3d12_replay.cpp @@ -120,7 +120,7 @@ void D3D12Replay::CreateResources() m_PixelPick.Init(m_pDevice, m_DebugManager); m_Histogram.Init(m_pDevice, m_DebugManager); - if(!m_Proxy && D3D12_HardwareCounters) + if(!m_Proxy && D3D12_HardwareCounters()) { AMDCounters *counters = NULL; diff --git a/renderdoc/driver/gl/gl_replay.cpp b/renderdoc/driver/gl/gl_replay.cpp index 2d2a9e3bf..bc3d29bca 100644 --- a/renderdoc/driver/gl/gl_replay.cpp +++ b/renderdoc/driver/gl/gl_replay.cpp @@ -231,7 +231,7 @@ void GLReplay::SetReplayData(GLWindowingData data) if(!HasDebugContext()) return; - if(!m_Proxy && OpenGL_HardwareCounters) + if(!m_Proxy && OpenGL_HardwareCounters()) { AMDCounters *countersAMD = NULL; IntelGlCounters *countersIntel = NULL; diff --git a/renderdoc/driver/ihv/amd/amd_rgp.cpp b/renderdoc/driver/ihv/amd/amd_rgp.cpp index 29f5231a8..4e8b4853b 100644 --- a/renderdoc/driver/ihv/amd/amd_rgp.cpp +++ b/renderdoc/driver/ihv/amd/amd_rgp.cpp @@ -71,7 +71,7 @@ AMDRGPControl::AMDRGPControl() m_RGPDispatchTable->minorVersion = DEV_DRIVER_API_MINOR_VERSION; m_RGPContext = NULL; - if(!AMD_RGP_Enable) + if(!AMD_RGP_Enable()) { RDCLOG("AMD RGP Interop is not enabled"); return; diff --git a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp index 66ac40c99..33899f811 100644 --- a/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp +++ b/renderdoc/driver/shaders/dxbc/dxbc_disassemble.cpp @@ -442,7 +442,7 @@ void Program::DisassembleHexDump() m_Declarations.reserve(numDecls); - const bool friendly = DXBC_Disassembly_FriendlyNaming; + const bool friendly = DXBC_Disassembly_FriendlyNaming(); while(cur < end) { diff --git a/renderdoc/driver/vulkan/vk_bindless_feedback.cpp b/renderdoc/driver/vulkan/vk_bindless_feedback.cpp index b56acf80b..37e8f8894 100644 --- a/renderdoc/driver/vulkan/vk_bindless_feedback.cpp +++ b/renderdoc/driver/vulkan/vk_bindless_feedback.cpp @@ -538,7 +538,7 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId) if(m_BindlessFeedback.Usage.find(eventId) != m_BindlessFeedback.Usage.end()) return; - if(!Vulkan_BindlessFeedback) + if(!Vulkan_BindlessFeedback()) return; // create it here so we won't re-run any code if the event is re-selected. We'll mark it as valid diff --git a/renderdoc/driver/vulkan/vk_debug.cpp b/renderdoc/driver/vulkan/vk_debug.cpp index 932b21804..f3320849e 100644 --- a/renderdoc/driver/vulkan/vk_debug.cpp +++ b/renderdoc/driver/vulkan/vk_debug.cpp @@ -2229,7 +2229,7 @@ void VulkanReplay::CreateResources() GPA_vkContextOpenInfo context = {Unwrap(m_pDriver->GetInstance()), Unwrap(m_pDriver->GetPhysDev()), Unwrap(m_pDriver->GetDev())}; - if(!m_pDriver->GetReplay()->IsRemoteProxy() && Vulkan_HardwareCounters) + if(!m_pDriver->GetReplay()->IsRemoteProxy() && Vulkan_HardwareCounters()) { AMDCounters *counters = NULL; diff --git a/renderdoc/driver/vulkan/vk_memory.cpp b/renderdoc/driver/vulkan/vk_memory.cpp index c754db8e6..dc9cfc006 100644 --- a/renderdoc/driver/vulkan/vk_memory.cpp +++ b/renderdoc/driver/vulkan/vk_memory.cpp @@ -162,7 +162,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR // invalidate/flush safely. This is at most 256 bytes which is likely already satisfied. ret.size = AlignUp(ret.size, nonCoherentAtomSize); - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("Allocating 0x%llx (0x%llx requested) with alignment 0x%llx in 0x%x for a %s (%s in %s)", ret.size, mrq.size, mrq.alignment, mrq.memoryTypeBits, buffer ? "buffer" : "image", @@ -175,7 +175,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR int i = 0; for(MemoryAllocation &block : blockList) { - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG( "Considering block %d: memory type %u and type %s. Total size 0x%llx, current offset " @@ -188,7 +188,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR // skip this block if it's not the memory type we want if(ret.type != block.type || (mrq.memoryTypeBits & (1 << block.memoryTypeIndex)) == 0) { - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("block type %d or memory type %d is incompatible", block.type, block.memoryTypeIndex); } @@ -207,7 +207,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR if(offs > block.size) { - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("Next offset 0x%llx would be off the end of the memory (size 0x%llx).", offs, block.size); @@ -217,7 +217,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR VkDeviceSize avail = block.size - offs; - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("At next offset 0x%llx, there's 0x%llx bytes available for 0x%llx bytes requested", offs, avail, ret.size); @@ -234,7 +234,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR ret.offs = offs; ret.mem = block.mem; - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("Allocating using this block: 0x%llx -> 0x%llx", ret.offs, block.offs); } @@ -246,7 +246,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR if(ret.mem == VK_NULL_HANDLE) { - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("No available block found - allocating new block"); } @@ -280,7 +280,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR { if(mrq.memoryTypeBits > (1U << m)) { - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("Avoiding memory type %u due to small heap size (%llu)", m, m_PhysicalDeviceData.memProps.memoryHeaps[heap].size); @@ -316,7 +316,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR // if it's still over-sized, just allocate precisely enough and give it a dedicated allocation if(ret.size > info.allocationSize) { - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("Over-sized allocation for 0x%llx bytes", ret.size); } @@ -324,7 +324,7 @@ MemoryAllocation WrappedVulkan::AllocateMemoryForResource(bool buffer, VkMemoryR } } - if(Vulkan_Debug_MemoryAllocationLogging) + if(Vulkan_Debug_MemoryAllocationLogging()) { RDCLOG("Creating new allocation of 0x%llx bytes", info.allocationSize); } diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp index 116cdcd8c..953123119 100644 --- a/renderdoc/driver/vulkan/vk_replay.cpp +++ b/renderdoc/driver/vulkan/vk_replay.cpp @@ -191,8 +191,8 @@ APIProperties VulkanReplay::GetAPIProperties() ret.shadersMutable = false; ret.rgpCapture = m_DriverInfo.vendor == GPUVendor::AMD && m_RGP != NULL && m_RGP->DriverSupportsInterop(); - ret.shaderDebugging = Vulkan_ShaderDebugging; - ret.pixelHistory = Vulkan_PixelHistory; + ret.shaderDebugging = Vulkan_ShaderDebugging(); + ret.pixelHistory = Vulkan_PixelHistory(); return ret; } diff --git a/renderdoc/driver/vulkan/vk_shaderdebug.cpp b/renderdoc/driver/vulkan/vk_shaderdebug.cpp index 776d1747e..98a37c5fa 100644 --- a/renderdoc/driver/vulkan/vk_shaderdebug.cpp +++ b/renderdoc/driver/vulkan/vk_shaderdebug.cpp @@ -1477,8 +1477,8 @@ private: "/debug_psmath.spv", }; - if(!Vulkan_Debug_PSDebugDumpDirPath.empty()) - FileIO::WriteAll(Vulkan_Debug_PSDebugDumpDirPath + filename[shaderIndex], spirv); + if(!Vulkan_Debug_PSDebugDumpDirPath().empty()) + FileIO::WriteAll(Vulkan_Debug_PSDebugDumpDirPath() + filename[shaderIndex], spirv); } uint32_t key = params.hashKey(shaderIndex); @@ -3322,7 +3322,7 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u VkMarkerRegion region(regionName); - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("%s", regionName.c_str()); const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); @@ -3372,7 +3372,7 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u if(attr.location >= locations.size()) locations.resize(attr.location + 1); - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("Populating location %u", attr.location); ShaderValue &val = locations[attr.location].value; @@ -3403,7 +3403,7 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u vertexOffset = (idx + vertOffset) * bind.bytestride; } - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Fetching from %s at %llu offset %zu bytes", ToStr(vb.buf).c_str(), vb.offs + attr.byteoffset + vertexOffset, size); @@ -3412,13 +3412,13 @@ ShaderDebugTrace *VulkanReplay::DebugVertex(uint32_t eventId, uint32_t vertid, u GetDebugManager()->GetBufferData(vb.buf, vb.offs + attr.byteoffset + vertexOffset, size, data); } - else if(Vulkan_Debug_ShaderDebugLogging) + else if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Vertex binding %u out of bounds from %zu vertex buffers", bind.vbufferBinding, state.vbuffers.size()); } } - else if(Vulkan_Debug_ShaderDebugLogging) + else if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Attribute binding %u out of bounds from %zu bindings", attr.binding, pipe.vertexBindings.size()); @@ -3485,7 +3485,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ VkMarkerRegion region(regionName); - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("%s", regionName.c_str()); const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId); @@ -3529,7 +3529,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ { if(e.systemValue == ShaderBuiltin::PrimitiveIndex) { - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Geometry shader exports primitive ID, can use"); } @@ -3539,7 +3539,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ } } - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { if(!usePrimitiveID) RDCLOG("Geometry shader doesn't export primitive ID, can't use"); @@ -3550,7 +3550,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ // no geometry shader - safe to use as long as the geometry shader capability is available usePrimitiveID = m_pDriver->GetDeviceFeatures().geometryShader != VK_FALSE; - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("usePrimitiveID is %u because of bare capability", usePrimitiveID); } @@ -3558,7 +3558,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ bool useSampleID = m_pDriver->GetDeviceFeatures().sampleRateShading != VK_FALSE; - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("useSampleID is %u because of bare capability", useSampleID); } @@ -3569,7 +3569,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ { storageMode = KHR_bda; - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Using KHR_buffer_device_address"); } @@ -3580,12 +3580,12 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ { storageMode = EXT_bda; - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Using EXT_buffer_device_address"); } } - else if(Vulkan_Debug_ShaderDebugLogging) + else if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG( "EXT_buffer_device_address is available but shaderInt64 isn't, falling back to binding " @@ -3593,19 +3593,19 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ } } - if(Vulkan_Debug_DisableBufferDeviceAddress) + if(Vulkan_Debug_DisableBufferDeviceAddress()) storageMode = Binding; rdcarray fragspv = shader.spirv.GetSPIRV(); - if(!Vulkan_Debug_PSDebugDumpDirPath.empty()) - FileIO::WriteAll(Vulkan_Debug_PSDebugDumpDirPath + "/debug_psinput_before.spv", fragspv); + if(!Vulkan_Debug_PSDebugDumpDirPath().empty()) + FileIO::WriteAll(Vulkan_Debug_PSDebugDumpDirPath() + "/debug_psinput_before.spv", fragspv); uint32_t structStride = 0; CreatePSInputFetcher(fragspv, structStride, shadRefl, storageMode, usePrimitiveID, useSampleID); - if(!Vulkan_Debug_PSDebugDumpDirPath.empty()) - FileIO::WriteAll(Vulkan_Debug_PSDebugDumpDirPath + "/debug_psinput_after.spv", fragspv); + if(!Vulkan_Debug_PSDebugDumpDirPath().empty()) + FileIO::WriteAll(Vulkan_Debug_PSDebugDumpDirPath() + "/debug_psinput_after.spv", fragspv); uint32_t overdrawLevels = 100; // maximum number of overdraw levels @@ -3618,7 +3618,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ VkDeviceSize feedbackStorageSize = overdrawLevels * structSize + sizeof(Vec4f) + 1024; - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Output structure is %u sized, output buffer is %llu bytes", structStride, feedbackStorageSize); @@ -3666,7 +3666,7 @@ ShaderDebugTrace *VulkanReplay::DebugPixel(uint32_t eventId, uint32_t x, uint32_ else specData.bufferAddress = m_pDriver->vkGetBufferDeviceAddressEXT(dev, &getAddressInfo); - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) { RDCLOG("Got buffer address of %llu", specData.bufferAddress); } @@ -4139,7 +4139,7 @@ ShaderDebugTrace *VulkanReplay::DebugThread(uint32_t eventId, const uint32_t gro VkMarkerRegion region(regionName); - if(Vulkan_Debug_ShaderDebugLogging) + if(Vulkan_Debug_ShaderDebugLogging()) RDCLOG("%s", regionName.c_str()); const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId);