diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt
index ebb1d5494..bb2dfe7ce 100644
--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -214,6 +214,8 @@ set(sources
serialise/comp_io_tests.cpp
serialise/serialiser_tests.cpp
serialise/streamio_tests.cpp
+ shaders/controlflow.cpp
+ shaders/controlflow.h
strings/grisu2.cpp
strings/string_utils.cpp
strings/string_utils.h
diff --git a/renderdoc/driver/shaders/spirv/CMakeLists.txt b/renderdoc/driver/shaders/spirv/CMakeLists.txt
index c7d658847..b86de1c4c 100644
--- a/renderdoc/driver/shaders/spirv/CMakeLists.txt
+++ b/renderdoc/driver/shaders/spirv/CMakeLists.txt
@@ -99,7 +99,6 @@ set(sources
glslang_compile.h
spirv_common.cpp
spirv_common.h
- spirv_controlflow.cpp
spirv_editor.cpp
spirv_editor.h
spirv_gen.cpp
diff --git a/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj b/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj
index 8609bb533..7a6914e57 100644
--- a/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj
+++ b/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj
@@ -155,12 +155,6 @@
precompiled.h
precompiled.h
-
- Level4
- Use
- precompiled.h
- precompiled.h
-
Level4
Use
@@ -273,7 +267,6 @@
-
diff --git a/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj.filters b/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj.filters
index 07ddccf18..7512f943e 100644
--- a/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj.filters
+++ b/renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj.filters
@@ -137,7 +137,6 @@
JSON-Generated helpers
-
@@ -298,7 +297,6 @@
JSON-Generated helpers
-
diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.cpp b/renderdoc/driver/shaders/spirv/spirv_debug.cpp
index a700aff06..4db95d2e2 100644
--- a/renderdoc/driver/shaders/spirv/spirv_debug.cpp
+++ b/renderdoc/driver/shaders/spirv/spirv_debug.cpp
@@ -33,6 +33,8 @@
#include "replay/common/var_dispatch_helpers.h"
#include "spirv_op_helpers.h"
+using namespace rdcshaders;
+
static bool ContainsNaNInf(const ShaderVariable &var)
{
bool ret = false;
diff --git a/renderdoc/driver/shaders/spirv/spirv_debug.h b/renderdoc/driver/shaders/spirv/spirv_debug.h
index 5b12a8a44..93df298b8 100644
--- a/renderdoc/driver/shaders/spirv/spirv_debug.h
+++ b/renderdoc/driver/shaders/spirv/spirv_debug.h
@@ -26,8 +26,8 @@
#include "api/replay/rdcarray.h"
#include "maths/vec.h"
+#include "shaders/controlflow.h"
#include "spirv_common.h"
-#include "spirv_controlflow.h"
#include "spirv_processor.h"
struct SPIRVInterfaceAccess;
@@ -536,7 +536,7 @@ private:
rdcarray activeLocalMappings;
} m_DebugInfo;
- rdcspv::ControlFlow controlFlow;
+ rdcshaders::ControlFlow controlFlow;
const ScopeData *GetScope(size_t offset) const;
};
diff --git a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp
index 134596449..300a042c1 100644
--- a/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp
+++ b/renderdoc/driver/shaders/spirv/spirv_debug_setup.cpp
@@ -36,6 +36,8 @@ RDOC_DEBUG_CONFIG(
bool, Vulkan_Hack_EnableGroupCaps, false,
"Work in progress allow shaders to be debugged with subgroup/workgroup requirements.");
+using namespace rdcshaders;
+
// this could be cleaner if ShaderVariable wasn't a very public struct, but it's not worth it so
// we just reserve value slots that we know won't be used in opaque variables.
// there's significant wasted space to keep things simple with one property = one slot
@@ -1561,7 +1563,7 @@ ShaderDebugTrace *Debugger::BeginDebug(DebugAPIWrapper *api, const ShaderStage s
std::sort(liveGlobals.begin(), liveGlobals.end());
- rdcarray threadIds;
+ rdcarray threadIds;
for(uint32_t i = 0; i < threadsInWorkgroup; i++)
{
ThreadState &lane = workgroup[i];
@@ -2547,7 +2549,7 @@ rdcarray Debugger::ContinueDebug()
if(!tangle.IsAliveActive())
continue;
- rdcarray threadRefs = tangle.GetThreadRefs();
+ rdcarray threadRefs = tangle.GetThreadRefs();
// calculate the current active thread mask from the threads in the tangle
{
// one bool per workgroup thread
@@ -2558,7 +2560,7 @@ rdcarray Debugger::ContinueDebug()
activeMask[i] = false;
// activate the threads in the tangle
- for(const rdcspv::ThreadReference &ref : threadRefs)
+ for(const ThreadReference &ref : threadRefs)
{
uint32_t idx = ref.id;
RDCASSERT(idx < workgroup.size(), idx, workgroup.size());
diff --git a/renderdoc/renderdoc.vcxproj b/renderdoc/renderdoc.vcxproj
index eac7a3a41..7958ef57c 100644
--- a/renderdoc/renderdoc.vcxproj
+++ b/renderdoc/renderdoc.vcxproj
@@ -251,6 +251,7 @@
+
@@ -655,6 +656,7 @@
+
diff --git a/renderdoc/renderdoc.vcxproj.filters b/renderdoc/renderdoc.vcxproj.filters
index 227b2ea04..08cc9a2f9 100644
--- a/renderdoc/renderdoc.vcxproj.filters
+++ b/renderdoc/renderdoc.vcxproj.filters
@@ -142,6 +142,9 @@
{02773850-117a-47d9-b238-d5d4b96468b3}
+
+ {d8130624-7075-486d-91fc-b5ab8cd2b811}
+
@@ -573,6 +576,9 @@
Common\File Formats
+
+ Shaders
+
@@ -977,6 +983,9 @@
Common
+
+ Shaders
+
diff --git a/renderdoc/driver/shaders/spirv/spirv_controlflow.cpp b/renderdoc/shaders/controlflow.cpp
similarity index 98%
rename from renderdoc/driver/shaders/spirv/spirv_controlflow.cpp
rename to renderdoc/shaders/controlflow.cpp
index 57f37df1c..6bcffb2aa 100644
--- a/renderdoc/driver/shaders/spirv/spirv_controlflow.cpp
+++ b/renderdoc/shaders/controlflow.cpp
@@ -22,7 +22,7 @@
* THE SOFTWARE.
******************************************************************************/
-#include "spirv_controlflow.h"
+#include "controlflow.h"
#include "api/replay/rdcstr.h"
#include "api/replay/stringise.h"
#include "common/common.h"
@@ -30,7 +30,7 @@
#include
-RDOC_CONFIG(bool, Vulkan_Debug_ControlFlow_Logging, false,
+RDOC_CONFIG(bool, Shader_Debug_ControlFlow_Logging, false,
"Debug logging for shader debugger controlflow");
/*
@@ -112,7 +112,7 @@ UpdateState():
* Prune deactivated tangles from the TangleGroup
*/
-namespace rdcspv
+namespace rdcshaders
{
int32_t ControlFlow::s_NextTangleId = 0;
@@ -258,7 +258,7 @@ TangleGroup ControlFlow::DivergeTangle(Tangle &tangle)
tangle.SetAlive(false);
RDCASSERTEQUAL(tangle.GetThreadCount(), 0U);
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG("Tangle:%u ThreadCount:%u diverged", tangle.GetId(), tangle.GetThreadCount());
for(Tangle &newTangle : newTangles)
@@ -342,7 +342,7 @@ void ControlFlow::ActivateIndependentTangles()
RDCASSERTNOTEQUAL(tangle.GetMergePoint(), INVALID_EXECUTION_POINT);
tangle.PopMergePoint();
tangle.SetStateChanged(true);
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG("Tangle:%u ThreadCount:%u at ExecPoint:%u activated new MergePoint:%u", tangle.GetId(),
tangle.GetThreadCount(), tangle.GetExecutionPoint(), tangle.GetMergePoint());
@@ -377,7 +377,7 @@ void ControlFlow::ProcessTangleConvergence()
// if the tangle converged to a function return point
if(tangle.GetExecutionPoint() == tangle.GetFunctionReturnPoint())
{
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG(
"Tangle:%u ThreadCount:%u is converged at ExecPoint:%u FunctionReturnPoint:%u "
@@ -404,7 +404,7 @@ void ControlFlow::MergeConvergedTangles()
if(!tangle.IsConverged())
continue;
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG("Tangle:%u ThreadCount:%u is converged at ExecPoint:%u Next MergePoint:%u",
tangle.GetId(), tangle.GetThreadCount(), tangle.GetExecutionPoint(),
@@ -435,7 +435,7 @@ void ControlFlow::MergeConvergedTangles()
convTangle.SetConverged(false);
convTangle.SetDiverged(false);
convTangle.SetAlive(false);
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG(
"Tangle:%u ThreadCount:%u converged with Tangle:%u ThreadCount:%u ExecPoint:%u at "
@@ -543,7 +543,7 @@ void ControlFlow::UpdateState(const ThreadExecutionStates &threadExecutionStates
tangle.PruneMergePoints(tangle.GetFunctionReturnPoint());
tangle.PopFunctionReturnPoint();
tangle.SetStateChanged(true);
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG(
"Tangle:%u ThreadCount:% at ExecPoint:%u auto-activated FunctionReturnPoint:%u "
@@ -560,7 +560,7 @@ void ControlFlow::UpdateState(const ThreadExecutionStates &threadExecutionStates
tangle.SetConverged(true);
tangle.SetDiverged(false);
tangle.SetStateChanged(true);
- if(Vulkan_Debug_ControlFlow_Logging())
+ if(Shader_Debug_ControlFlow_Logging())
{
RDCLOG("Tangle:%u ThreadCount:%u at ExecPoint:%u auto-activated new MergePoint:%u",
tangle.GetId(), tangle.GetThreadCount(), tangle.GetExecutionPoint(),
@@ -626,14 +626,14 @@ void ControlFlow::Construct(const rdcarray &threadIds)
m_Tangles.clear();
m_Tangles.push_back(rootTangle);
}
-}; // namespace rdcspv
+}; // namespace rdcshaders
#if ENABLED(ENABLE_UNIT_TESTS)
#include
#include "catch/catch.hpp"
-using namespace rdcspv;
+using namespace rdcshaders;
const ExecutionPoint EXEC_POINT_1 = 1;
const ExecutionPoint EXEC_POINT_2 = 2;
@@ -843,7 +843,7 @@ void RunTest(const Program &program, const rdcarray &expected)
}
}
-TEST_CASE("SPIRV Control Flow", "[spirv][controlflow]")
+TEST_CASE("Shader Control Flow", "[shader][controlflow]")
{
SECTION("Maximal Reconvergence")
{
diff --git a/renderdoc/driver/shaders/spirv/spirv_controlflow.h b/renderdoc/shaders/controlflow.h
similarity index 99%
rename from renderdoc/driver/shaders/spirv/spirv_controlflow.h
rename to renderdoc/shaders/controlflow.h
index 3e8bc5e7c..e0e711f2c 100644
--- a/renderdoc/driver/shaders/spirv/spirv_controlflow.h
+++ b/renderdoc/shaders/controlflow.h
@@ -28,7 +28,7 @@
#include "api/replay/rdcflatmap.h"
#include "os/os_specific.h"
-namespace rdcspv
+namespace rdcshaders
{
class Tangle;
class ControlFlow;
@@ -211,4 +211,4 @@ private:
static int32_t s_NextTangleId;
};
-}; // namespace rdcspv
+}; // namespace rdcshaders