mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-14 01:41:10 +00:00
Change RDCDriver to enum class, don't manually stringify anywhere
This commit is contained in:
24 files changed
+129
-129
No files matched your search
+29
-37
@@ -64,17 +64,17 @@ std::string DoStringise(const RDCDriver &el)
|
||||
{
|
||||
BEGIN_ENUM_STRINGISE(RDCDriver);
|
||||
{
|
||||
STRINGISE_ENUM_NAMED(RDC_Unknown, "Unknown");
|
||||
STRINGISE_ENUM_NAMED(RDC_OpenGL, "OpenGL");
|
||||
STRINGISE_ENUM_NAMED(RDC_OpenGLES, "OpenGLES");
|
||||
STRINGISE_ENUM_NAMED(RDC_Mantle, "Mantle");
|
||||
STRINGISE_ENUM_NAMED(RDC_D3D12, "D3D12");
|
||||
STRINGISE_ENUM_NAMED(RDC_D3D11, "D3D11");
|
||||
STRINGISE_ENUM_NAMED(RDC_D3D10, "D3D10");
|
||||
STRINGISE_ENUM_NAMED(RDC_D3D9, "D3D9");
|
||||
STRINGISE_ENUM_NAMED(RDC_D3D8, "D3D8");
|
||||
STRINGISE_ENUM_NAMED(RDC_Image, "Image");
|
||||
STRINGISE_ENUM_NAMED(RDC_Vulkan, "Vulkan");
|
||||
STRINGISE_ENUM_CLASS(Unknown);
|
||||
STRINGISE_ENUM_CLASS(OpenGL);
|
||||
STRINGISE_ENUM_CLASS(OpenGLES);
|
||||
STRINGISE_ENUM_CLASS(Mantle);
|
||||
STRINGISE_ENUM_CLASS(D3D12);
|
||||
STRINGISE_ENUM_CLASS(D3D11);
|
||||
STRINGISE_ENUM_CLASS(D3D10);
|
||||
STRINGISE_ENUM_CLASS(D3D9);
|
||||
STRINGISE_ENUM_CLASS(D3D8);
|
||||
STRINGISE_ENUM_CLASS(Image);
|
||||
STRINGISE_ENUM_CLASS(Vulkan);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -201,7 +201,7 @@ RenderDoc::RenderDoc()
|
||||
{
|
||||
m_LogFile = "";
|
||||
m_MarkerIndentLevel = 0;
|
||||
m_CurrentDriver = RDC_Unknown;
|
||||
m_CurrentDriver = RDCDriver::Unknown;
|
||||
|
||||
m_CapturesActive = 0;
|
||||
|
||||
@@ -731,7 +731,7 @@ RDCFile *RenderDoc::CreateRDC(uint32_t frameNum, void *thpixels, size_t thlen, u
|
||||
thumb = &th;
|
||||
}
|
||||
|
||||
ret->SetData(m_CurrentDriver, m_CurrentDriverName.c_str(), OSUtility::GetMachineIdent(), thumb);
|
||||
ret->SetData(m_CurrentDriver, ToStr(m_CurrentDriver).c_str(), OSUtility::GetMachineIdent(), thumb);
|
||||
|
||||
ret->Create(m_CurrentLogFile.c_str());
|
||||
|
||||
@@ -747,7 +747,7 @@ RDCFile *RenderDoc::CreateRDC(uint32_t frameNum, void *thpixels, size_t thlen, u
|
||||
bool RenderDoc::HasReplayDriver(RDCDriver driver) const
|
||||
{
|
||||
// Image driver is handled specially and isn't registered in the map
|
||||
if(driver == RDC_Image)
|
||||
if(driver == RDCDriver::Image)
|
||||
return true;
|
||||
|
||||
return m_ReplayDriverProviders.find(driver) != m_ReplayDriverProviders.end();
|
||||
@@ -761,29 +761,23 @@ bool RenderDoc::HasRemoteDriver(RDCDriver driver) const
|
||||
return HasReplayDriver(driver);
|
||||
}
|
||||
|
||||
void RenderDoc::RegisterReplayProvider(RDCDriver driver, const char *name,
|
||||
ReplayDriverProvider provider)
|
||||
void RenderDoc::RegisterReplayProvider(RDCDriver driver, ReplayDriverProvider provider)
|
||||
{
|
||||
if(HasReplayDriver(driver))
|
||||
RDCERR("Re-registering provider for %s (was %s)", name, m_DriverNames[driver].c_str());
|
||||
RDCERR("Re-registering provider for %s", ToStr(driver).c_str());
|
||||
if(HasRemoteDriver(driver))
|
||||
RDCWARN("Registering local provider %s for existing remote provider %s", name,
|
||||
m_DriverNames[driver].c_str());
|
||||
RDCWARN("Registering local provider for existing remote provider %s", ToStr(driver).c_str());
|
||||
|
||||
m_DriverNames[driver] = name;
|
||||
m_ReplayDriverProviders[driver] = provider;
|
||||
}
|
||||
|
||||
void RenderDoc::RegisterRemoteProvider(RDCDriver driver, const char *name,
|
||||
RemoteDriverProvider provider)
|
||||
void RenderDoc::RegisterRemoteProvider(RDCDriver driver, RemoteDriverProvider provider)
|
||||
{
|
||||
if(HasRemoteDriver(driver))
|
||||
RDCERR("Re-registering provider for %s (was %s)", name, m_DriverNames[driver].c_str());
|
||||
RDCERR("Re-registering provider for %s", ToStr(driver).c_str());
|
||||
if(HasReplayDriver(driver))
|
||||
RDCWARN("Registering remote provider %s for existing local provider %s", name,
|
||||
m_DriverNames[driver].c_str());
|
||||
RDCWARN("Registering remote provider for existing local provider %s", ToStr(driver).c_str());
|
||||
|
||||
m_DriverNames[driver] = name;
|
||||
m_RemoteDriverProviders[driver] = provider;
|
||||
}
|
||||
|
||||
@@ -882,10 +876,10 @@ std::vector<CaptureFileFormat> RenderDoc::GetCaptureFileFormats()
|
||||
|
||||
bool RenderDoc::HasReplaySupport(RDCDriver driverType)
|
||||
{
|
||||
if(driverType == RDC_Image)
|
||||
if(driverType == RDCDriver::Image)
|
||||
return true;
|
||||
|
||||
if(driverType == RDC_Unknown && !m_ReplayDriverProviders.empty())
|
||||
if(driverType == RDCDriver::Unknown && !m_ReplayDriverProviders.empty())
|
||||
return true;
|
||||
|
||||
return m_ReplayDriverProviders.find(driverType) != m_ReplayDriverProviders.end();
|
||||
@@ -893,8 +887,8 @@ bool RenderDoc::HasReplaySupport(RDCDriver driverType)
|
||||
|
||||
ReplayStatus RenderDoc::CreateProxyReplayDriver(RDCDriver proxyDriver, IReplayDriver **driver)
|
||||
{
|
||||
// passing RDC_Unknown means 'I don't care, give me a proxy driver of any type'
|
||||
if(proxyDriver == RDC_Unknown)
|
||||
// passing RDCDriver::Unknown means 'I don't care, give me a proxy driver of any type'
|
||||
if(proxyDriver == RDCDriver::Unknown)
|
||||
{
|
||||
if(!m_ReplayDriverProviders.empty())
|
||||
return m_ReplayDriverProviders.begin()->second(NULL, driver);
|
||||
@@ -925,7 +919,7 @@ ReplayStatus RenderDoc::CreateReplayDriver(RDCFile *rdc, IReplayDriver **driver)
|
||||
RDCDriver driverType = rdc->GetDriver();
|
||||
|
||||
// image support is special, handle it here
|
||||
if(driverType == RDC_Image)
|
||||
if(driverType == RDCDriver::Image)
|
||||
return IMG_CreateReplayDevice(rdc, driver);
|
||||
|
||||
if(m_ReplayDriverProviders.find(driverType) != m_ReplayDriverProviders.end())
|
||||
@@ -970,20 +964,18 @@ void RenderDoc::SetCurrentDriver(RDCDriver driver)
|
||||
RDCFATAL("Trying to register unsupported driver!");
|
||||
}
|
||||
m_CurrentDriver = driver;
|
||||
m_CurrentDriverName = m_DriverNames[driver];
|
||||
}
|
||||
|
||||
void RenderDoc::GetCurrentDriver(RDCDriver &driver, string &name)
|
||||
void RenderDoc::GetCurrentDriver(RDCDriver &driver)
|
||||
{
|
||||
driver = m_CurrentDriver;
|
||||
name = m_CurrentDriverName;
|
||||
}
|
||||
|
||||
map<RDCDriver, string> RenderDoc::GetReplayDrivers()
|
||||
{
|
||||
map<RDCDriver, string> ret;
|
||||
for(auto it = m_ReplayDriverProviders.begin(); it != m_ReplayDriverProviders.end(); ++it)
|
||||
ret[it->first] = m_DriverNames[it->first];
|
||||
ret[it->first] = ToStr(it->first);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -992,11 +984,11 @@ map<RDCDriver, string> RenderDoc::GetRemoteDrivers()
|
||||
map<RDCDriver, string> ret;
|
||||
|
||||
for(auto it = m_RemoteDriverProviders.begin(); it != m_RemoteDriverProviders.end(); ++it)
|
||||
ret[it->first] = m_DriverNames[it->first];
|
||||
ret[it->first] = ToStr(it->first);
|
||||
|
||||
// replay drivers are remote drivers.
|
||||
for(auto it = m_ReplayDriverProviders.begin(); it != m_ReplayDriverProviders.end(); ++it)
|
||||
ret[it->first] = m_DriverNames[it->first];
|
||||
ret[it->first] = ToStr(it->first);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
+31
-33
@@ -162,31 +162,31 @@ enum class SystemChunk : uint32_t
|
||||
|
||||
DECLARE_REFLECTION_ENUM(SystemChunk);
|
||||
|
||||
enum RDCDriver
|
||||
enum class RDCDriver
|
||||
{
|
||||
RDC_Unknown = 0,
|
||||
RDC_D3D11 = 1,
|
||||
RDC_OpenGL = 2,
|
||||
RDC_Mantle = 3,
|
||||
RDC_D3D12 = 4,
|
||||
RDC_D3D10 = 5,
|
||||
RDC_D3D9 = 6,
|
||||
RDC_Image = 7,
|
||||
RDC_Vulkan = 8,
|
||||
RDC_OpenGLES = 9,
|
||||
RDC_D3D8 = 10,
|
||||
RDC_MaxBuiltin,
|
||||
RDC_Custom = 100000,
|
||||
RDC_Custom0 = RDC_Custom,
|
||||
RDC_Custom1,
|
||||
RDC_Custom2,
|
||||
RDC_Custom3,
|
||||
RDC_Custom4,
|
||||
RDC_Custom5,
|
||||
RDC_Custom6,
|
||||
RDC_Custom7,
|
||||
RDC_Custom8,
|
||||
RDC_Custom9,
|
||||
Unknown = 0,
|
||||
D3D11 = 1,
|
||||
OpenGL = 2,
|
||||
Mantle = 3,
|
||||
D3D12 = 4,
|
||||
D3D10 = 5,
|
||||
D3D9 = 6,
|
||||
Image = 7,
|
||||
Vulkan = 8,
|
||||
OpenGLES = 9,
|
||||
D3D8 = 10,
|
||||
MaxBuiltin,
|
||||
Custom = 100000,
|
||||
Custom0 = Custom,
|
||||
Custom1,
|
||||
Custom2,
|
||||
Custom3,
|
||||
Custom4,
|
||||
Custom5,
|
||||
Custom6,
|
||||
Custom7,
|
||||
Custom8,
|
||||
Custom9,
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_ENUM(RDCDriver);
|
||||
@@ -318,8 +318,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterReplayProvider(RDCDriver driver, const char *name, ReplayDriverProvider provider);
|
||||
void RegisterRemoteProvider(RDCDriver driver, const char *name, RemoteDriverProvider provider);
|
||||
void RegisterReplayProvider(RDCDriver driver, ReplayDriverProvider provider);
|
||||
void RegisterRemoteProvider(RDCDriver driver, RemoteDriverProvider provider);
|
||||
|
||||
void RegisterStructuredProcessor(RDCDriver driver, StructuredProcessor provider);
|
||||
|
||||
@@ -371,7 +371,7 @@ public:
|
||||
bool HasRemoteDriver(RDCDriver driver) const;
|
||||
|
||||
void SetCurrentDriver(RDCDriver driver);
|
||||
void GetCurrentDriver(RDCDriver &driver, string &name);
|
||||
void GetCurrentDriver(RDCDriver &driver);
|
||||
|
||||
uint32_t GetTargetControlIdent() const { return m_RemoteIdent; }
|
||||
bool IsTargetControlConnected();
|
||||
@@ -460,7 +460,6 @@ private:
|
||||
|
||||
int32_t m_MarkerIndentLevel;
|
||||
RDCDriver m_CurrentDriver;
|
||||
string m_CurrentDriverName;
|
||||
|
||||
float *m_ProgressPtr;
|
||||
|
||||
@@ -472,7 +471,6 @@ private:
|
||||
|
||||
map<string, string> m_ConfigSettings;
|
||||
|
||||
map<RDCDriver, string> m_DriverNames;
|
||||
map<RDCDriver, ReplayDriverProvider> m_ReplayDriverProviders;
|
||||
map<RDCDriver, RemoteDriverProvider> m_RemoteDriverProviders;
|
||||
|
||||
@@ -548,13 +546,13 @@ private:
|
||||
|
||||
struct DriverRegistration
|
||||
{
|
||||
DriverRegistration(RDCDriver driver, const char *name, ReplayDriverProvider provider)
|
||||
DriverRegistration(RDCDriver driver, ReplayDriverProvider provider)
|
||||
{
|
||||
RenderDoc::Inst().RegisterReplayProvider(driver, name, provider);
|
||||
RenderDoc::Inst().RegisterReplayProvider(driver, provider);
|
||||
}
|
||||
DriverRegistration(RDCDriver driver, const char *name, RemoteDriverProvider provider)
|
||||
DriverRegistration(RDCDriver driver, RemoteDriverProvider provider)
|
||||
{
|
||||
RenderDoc::Inst().RegisterRemoteProvider(driver, name, provider);
|
||||
RenderDoc::Inst().RegisterRemoteProvider(driver, provider);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -395,7 +395,7 @@ ReplayStatus IMG_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
FileIO::fclose(f);
|
||||
|
||||
IReplayDriver *proxy = NULL;
|
||||
ReplayStatus status = RenderDoc::Inst().CreateProxyReplayDriver(RDC_Unknown, &proxy);
|
||||
ReplayStatus status = RenderDoc::Inst().CreateProxyReplayDriver(RDCDriver::Unknown, &proxy);
|
||||
|
||||
if(status != ReplayStatus::Succeeded || !proxy)
|
||||
{
|
||||
|
||||
@@ -1069,7 +1069,7 @@ public:
|
||||
|
||||
for(uint32_t i = 0; i < count; i++)
|
||||
{
|
||||
RDCDriver driverType = RDC_Unknown;
|
||||
RDCDriver driverType = RDCDriver::Unknown;
|
||||
std::string driverName = "";
|
||||
|
||||
SERIALISE_ELEMENT(driverType);
|
||||
@@ -1333,7 +1333,7 @@ public:
|
||||
|
||||
// if the proxy id is ~0U, then we just don't care so let RenderDoc pick the most
|
||||
// appropriate supported proxy for the current platform.
|
||||
RDCDriver proxydrivertype = proxyid == ~0U ? RDC_Unknown : m_Proxies[proxyid].first;
|
||||
RDCDriver proxydrivertype = proxyid == ~0U ? RDCDriver::Unknown : m_Proxies[proxyid].first;
|
||||
|
||||
{
|
||||
WRITE_DATA_SCOPE();
|
||||
|
||||
@@ -78,9 +78,8 @@ void RenderDoc::TargetControlClientThread(Network::Socket *client)
|
||||
writer.SetStreamingMode(true);
|
||||
reader.SetStreamingMode(true);
|
||||
|
||||
std::string api = "";
|
||||
RDCDriver driver;
|
||||
RenderDoc::Inst().GetCurrentDriver(driver, api);
|
||||
RenderDoc::Inst().GetCurrentDriver(driver);
|
||||
|
||||
std::string target = RenderDoc::Inst().GetCurrentTarget();
|
||||
uint32_t mypid = Process::GetCurrentPID();
|
||||
@@ -89,7 +88,7 @@ void RenderDoc::TargetControlClientThread(Network::Socket *client)
|
||||
WRITE_DATA_SCOPE();
|
||||
SCOPED_SERIALISE_CHUNK(ePacket_Handshake);
|
||||
SERIALISE_ELEMENT(target);
|
||||
SERIALISE_ELEMENT(api);
|
||||
SERIALISE_ELEMENT(driver);
|
||||
SERIALISE_ELEMENT(mypid);
|
||||
}
|
||||
|
||||
@@ -124,20 +123,20 @@ void RenderDoc::TargetControlClientThread(Network::Socket *client)
|
||||
Threading::Sleep(ticktime);
|
||||
curtime += ticktime;
|
||||
|
||||
std::string curapi;
|
||||
RenderDoc::Inst().GetCurrentDriver(driver, curapi);
|
||||
RDCDriver curdriver = RDCDriver::Unknown;
|
||||
RenderDoc::Inst().GetCurrentDriver(curdriver);
|
||||
|
||||
std::vector<CaptureData> caps = RenderDoc::Inst().GetCaptures();
|
||||
std::vector<pair<uint32_t, uint32_t> > childprocs = RenderDoc::Inst().GetChildProcesses();
|
||||
|
||||
if(curapi != api)
|
||||
if(curdriver != driver)
|
||||
{
|
||||
api = curapi;
|
||||
driver = curdriver;
|
||||
|
||||
WRITE_DATA_SCOPE();
|
||||
{
|
||||
SCOPED_SERIALISE_CHUNK(ePacket_RegisterAPI);
|
||||
SERIALISE_ELEMENT(api);
|
||||
SERIALISE_ELEMENT(driver);
|
||||
}
|
||||
}
|
||||
else if(caps.size() != captures.size())
|
||||
@@ -367,15 +366,14 @@ void RenderDoc::TargetControlServerThread(Network::Socket *sock)
|
||||
|
||||
ser.SetStreamingMode(true);
|
||||
|
||||
std::string api = "";
|
||||
RDCDriver driver;
|
||||
RenderDoc::Inst().GetCurrentDriver(driver, api);
|
||||
RenderDoc::Inst().GetCurrentDriver(driver);
|
||||
|
||||
std::string target = RenderDoc::Inst().GetCurrentTarget();
|
||||
{
|
||||
SCOPED_SERIALISE_CHUNK(ePacket_Busy);
|
||||
SERIALISE_ELEMENT(target);
|
||||
SERIALISE_ELEMENT(api);
|
||||
SERIALISE_ELEMENT(driver);
|
||||
SERIALISE_ELEMENT(RenderDoc::Inst().m_SingleClientName);
|
||||
}
|
||||
|
||||
@@ -444,10 +442,14 @@ public:
|
||||
return;
|
||||
|
||||
{
|
||||
RDCDriver driver = RDCDriver::Unknown;
|
||||
|
||||
READ_DATA_SCOPE();
|
||||
SERIALISE_ELEMENT(m_Target);
|
||||
SERIALISE_ELEMENT(m_API);
|
||||
SERIALISE_ELEMENT(driver);
|
||||
SERIALISE_ELEMENT(m_PID);
|
||||
|
||||
m_API = ToStr(driver);
|
||||
}
|
||||
|
||||
reader.EndChunk();
|
||||
@@ -634,8 +636,12 @@ public:
|
||||
{
|
||||
msg.type = TargetControlMessageType::RegisterAPI;
|
||||
|
||||
RDCDriver driver = RDCDriver::Unknown;
|
||||
|
||||
READ_DATA_SCOPE();
|
||||
SERIALISE_ELEMENT(msg.apiUse.name).Named("API Name");
|
||||
SERIALISE_ELEMENT(driver);
|
||||
|
||||
msg.apiUse.name = ToStr(driver);
|
||||
|
||||
RDCLOG("Used API: %s", msg.apiUse.name.c_str());
|
||||
|
||||
|
||||
@@ -1342,7 +1342,7 @@ void WrappedID3D11Device::StartFrameCapture(void *dev, void *wnd)
|
||||
if(!IsBackgroundCapturing(m_State))
|
||||
return;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_D3D11);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::D3D11);
|
||||
|
||||
m_State = CaptureState::ActiveCapturing;
|
||||
|
||||
@@ -2016,7 +2016,7 @@ HRESULT WrappedID3D11Device::Present(WrappedIDXGISwapChain4 *swap, UINT SyncInte
|
||||
GetDebugManager()->SetOutputWindow(swapDesc.OutputWindow);
|
||||
|
||||
int flags = activeWindow ? RenderDoc::eOverlay_ActiveWindow : 0;
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDC_D3D11, m_FrameCounter, flags);
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDCDriver::D3D11, m_FrameCounter, flags);
|
||||
|
||||
if(activeWindow && m_FailedFrame > 0)
|
||||
{
|
||||
@@ -2042,7 +2042,7 @@ HRESULT WrappedID3D11Device::Present(WrappedIDXGISwapChain4 *swap, UINT SyncInte
|
||||
if(!activeWindow)
|
||||
return S_OK;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_D3D11);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::D3D11);
|
||||
|
||||
// kill any current capture that isn't application defined
|
||||
if(IsActiveCapturing(m_State) && !m_AppControlledCapture)
|
||||
|
||||
@@ -2071,7 +2071,7 @@ ReplayStatus D3D11_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
return ReplayStatus::APIHardwareUnsupported;
|
||||
}
|
||||
|
||||
static DriverRegistration D3D11DriverRegistration(RDC_D3D11, "D3D11", &D3D11_CreateReplayDevice);
|
||||
static DriverRegistration D3D11DriverRegistration(RDCDriver::D3D11, &D3D11_CreateReplayDevice);
|
||||
|
||||
void D3D11_ProcessStructured(RDCFile *rdc, SDFile &output)
|
||||
{
|
||||
@@ -2089,4 +2089,5 @@ void D3D11_ProcessStructured(RDCFile *rdc, SDFile &output)
|
||||
device.GetStructuredFile().Swap(output);
|
||||
}
|
||||
|
||||
static StructuredProcessRegistration D3D11ProcessRegistration(RDC_D3D11, &D3D11_ProcessStructured);
|
||||
static StructuredProcessRegistration D3D11ProcessRegistration(RDCDriver::D3D11,
|
||||
&D3D11_ProcessStructured);
|
||||
@@ -1127,7 +1127,7 @@ HRESULT WrappedID3D12Device::Present(WrappedIDXGISwapChain4 *swap, UINT SyncInte
|
||||
list->OMSetRenderTargets(1, &rtv, FALSE, NULL);
|
||||
|
||||
int flags = activeWindow ? RenderDoc::eOverlay_ActiveWindow : 0;
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDC_D3D12, m_FrameCounter, flags);
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDCDriver::D3D12, m_FrameCounter, flags);
|
||||
|
||||
if(!overlayText.empty())
|
||||
GetDebugManager()->RenderText(list, 0.0f, 0.0f, overlayText.c_str());
|
||||
@@ -1146,7 +1146,7 @@ HRESULT WrappedID3D12Device::Present(WrappedIDXGISwapChain4 *swap, UINT SyncInte
|
||||
if(!activeWindow)
|
||||
return S_OK;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_D3D12);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::D3D12);
|
||||
|
||||
// kill any current capture that isn't application defined
|
||||
if(IsActiveCapturing(m_State) && !m_AppControlledCapture)
|
||||
@@ -1225,7 +1225,7 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd)
|
||||
if(!IsBackgroundCapturing(m_State))
|
||||
return;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_D3D12);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::D3D12);
|
||||
|
||||
m_AppControlledCapture = true;
|
||||
|
||||
|
||||
@@ -1832,7 +1832,7 @@ ReplayStatus D3D12_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
return ReplayStatus::Succeeded;
|
||||
}
|
||||
|
||||
static DriverRegistration D3D12DriverRegistration(RDC_D3D12, "D3D12", &D3D12_CreateReplayDevice);
|
||||
static DriverRegistration D3D12DriverRegistration(RDCDriver::D3D12, &D3D12_CreateReplayDevice);
|
||||
|
||||
void D3D12_ProcessStructured(RDCFile *rdc, SDFile &output)
|
||||
{
|
||||
@@ -1850,4 +1850,5 @@ void D3D12_ProcessStructured(RDCFile *rdc, SDFile &output)
|
||||
device.GetStructuredFile().Swap(output);
|
||||
}
|
||||
|
||||
static StructuredProcessRegistration D3D12ProcessRegistration(RDC_D3D12, &D3D12_ProcessStructured);
|
||||
static StructuredProcessRegistration D3D12ProcessRegistration(RDCDriver::D3D12,
|
||||
&D3D12_ProcessStructured);
|
||||
@@ -274,7 +274,7 @@ HRESULT __stdcall WrappedD3DDevice8::Present(CONST RECT *pSourceRect, CONST RECT
|
||||
int flags = activeWindow ? RenderDoc::eOverlay_ActiveWindow : 0;
|
||||
flags |= RenderDoc::eOverlay_CaptureDisabled;
|
||||
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDC_D3D8, m_FrameCounter, flags);
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDCDriver::D3D8, m_FrameCounter, flags);
|
||||
|
||||
overlayText += "Captures not supported with D3D8\n";
|
||||
|
||||
@@ -288,7 +288,7 @@ HRESULT __stdcall WrappedD3DDevice8::Present(CONST RECT *pSourceRect, CONST RECT
|
||||
|
||||
if(activeWindow)
|
||||
{
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_D3D8);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::D3D8);
|
||||
}
|
||||
|
||||
return m_device->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
|
||||
|
||||
@@ -30,4 +30,4 @@ ReplayStatus D3D8_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
return ReplayStatus::APIUnsupported;
|
||||
}
|
||||
|
||||
static DriverRegistration D3D8DriverRegistration(RDC_D3D8, "D3D8", &D3D8_CreateReplayDevice);
|
||||
static DriverRegistration D3D8DriverRegistration(RDCDriver::D3D8, &D3D8_CreateReplayDevice);
|
||||
@@ -242,7 +242,7 @@ HRESULT __stdcall WrappedD3DDevice9::Present(CONST RECT *pSourceRect, CONST RECT
|
||||
int flags = activeWindow ? RenderDoc::eOverlay_ActiveWindow : 0;
|
||||
flags |= RenderDoc::eOverlay_CaptureDisabled;
|
||||
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDC_D3D9, m_FrameCounter, flags);
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDCDriver::D3D9, m_FrameCounter, flags);
|
||||
|
||||
overlayText += "Captures not supported with D3D9\n";
|
||||
|
||||
@@ -256,7 +256,7 @@ HRESULT __stdcall WrappedD3DDevice9::Present(CONST RECT *pSourceRect, CONST RECT
|
||||
|
||||
if(activeWindow)
|
||||
{
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_D3D9);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::D3D9);
|
||||
}
|
||||
|
||||
return m_device->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
|
||||
|
||||
@@ -30,4 +30,4 @@ ReplayStatus D3D9_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
return ReplayStatus::APIUnsupported;
|
||||
}
|
||||
|
||||
static DriverRegistration D3D9DriverRegistration(RDC_D3D9, "D3D9", &D3D9_CreateReplayDevice);
|
||||
static DriverRegistration D3D9DriverRegistration(RDCDriver::D3D9, &D3D9_CreateReplayDevice);
|
||||
@@ -500,7 +500,7 @@ WrappedOpenGL::WrappedOpenGL(const GLHookSet &funcs, GLPlatform &platform)
|
||||
BuildGLExtensions();
|
||||
BuildGLESExtensions();
|
||||
// by default we assume OpenGL driver
|
||||
SetDriverType(RDC_OpenGL);
|
||||
SetDriverType(RDCDriver::OpenGL);
|
||||
|
||||
m_Replay.SetDriver(this);
|
||||
|
||||
|
||||
@@ -541,7 +541,7 @@ public:
|
||||
GLReplay *GetReplay() { return &m_Replay; }
|
||||
WriteSerialiser &GetSerialiser() { return m_ScratchSerialiser; }
|
||||
void SetDriverType(RDCDriver type) { m_DriverType = type; }
|
||||
bool isGLESMode() { return m_DriverType == RDC_OpenGLES; }
|
||||
bool isGLESMode() { return m_DriverType == RDCDriver::OpenGLES; }
|
||||
RDCDriver GetDriverType() { return m_DriverType; }
|
||||
GLInitParams &GetInitParams() { return m_InitParams; }
|
||||
static void *GetCtx();
|
||||
|
||||
@@ -190,7 +190,7 @@ public:
|
||||
if(m_GLDriver == NULL)
|
||||
{
|
||||
m_GLDriver = new WrappedOpenGL(GL, *this);
|
||||
m_GLDriver->SetDriverType(RDC_OpenGLES);
|
||||
m_GLDriver->SetDriverType(RDCDriver::OpenGLES);
|
||||
}
|
||||
|
||||
return m_GLDriver;
|
||||
@@ -226,7 +226,7 @@ void EGLHook::libHooked(void *realLib)
|
||||
{
|
||||
libGLdlsymHandle = realLib;
|
||||
eglhooks.CreateHooks(NULL);
|
||||
eglhooks.GetDriver()->SetDriverType(RDC_OpenGLES);
|
||||
eglhooks.GetDriver()->SetDriverType(RDCDriver::OpenGLES);
|
||||
}
|
||||
|
||||
// everything below here needs to have C linkage
|
||||
@@ -317,7 +317,7 @@ __attribute__((visibility("default"))) EGLContext eglCreateContext(EGLDisplay di
|
||||
data.egl_wnd = (EGLSurface)NULL;
|
||||
data.egl_ctx = ret;
|
||||
|
||||
eglhooks.GetDriver()->SetDriverType(RDC_OpenGLES);
|
||||
eglhooks.GetDriver()->SetDriverType(RDCDriver::OpenGLES);
|
||||
{
|
||||
SCOPED_LOCK(glLock);
|
||||
eglhooks.GetDriver()->CreateContext(data, shareContext, init, true, true);
|
||||
@@ -331,7 +331,7 @@ __attribute__((visibility("default"))) EGLBoolean eglDestroyContext(EGLDisplay d
|
||||
if(eglhooks.real.DestroyContext == NULL)
|
||||
eglhooks.SetupExportedFunctions();
|
||||
|
||||
eglhooks.GetDriver()->SetDriverType(RDC_OpenGLES);
|
||||
eglhooks.GetDriver()->SetDriverType(RDCDriver::OpenGLES);
|
||||
{
|
||||
SCOPED_LOCK(glLock);
|
||||
eglhooks.GetDriver()->DeleteContext(ctx);
|
||||
@@ -362,7 +362,7 @@ __attribute__((visibility("default"))) EGLBoolean eglMakeCurrent(EGLDisplay disp
|
||||
data.egl_wnd = draw;
|
||||
data.egl_ctx = ctx;
|
||||
|
||||
eglhooks.GetDriver()->SetDriverType(RDC_OpenGLES);
|
||||
eglhooks.GetDriver()->SetDriverType(RDCDriver::OpenGLES);
|
||||
eglhooks.GetDriver()->ActivateContext(data);
|
||||
|
||||
return ret;
|
||||
@@ -385,7 +385,7 @@ __attribute__((visibility("default"))) EGLBoolean eglSwapBuffers(EGLDisplay dpy,
|
||||
// GL_SRGB8_ALPHA8 is specified as color-renderable, unlike GL_SRGB8.
|
||||
init.isSRGB = init.colorBits == 32 && colorspace == EGL_GL_COLORSPACE_SRGB;
|
||||
|
||||
eglhooks.GetDriver()->SetDriverType(RDC_OpenGLES);
|
||||
eglhooks.GetDriver()->SetDriverType(RDCDriver::OpenGLES);
|
||||
eglhooks.GetDriver()->WindowSize(surface, width, height);
|
||||
eglhooks.GetDriver()->SwapBuffers(surface);
|
||||
|
||||
|
||||
@@ -3359,15 +3359,16 @@ void GL_ProcessStructured(RDCFile *rdc, SDFile &output)
|
||||
device.GetStructuredFile().Swap(output);
|
||||
}
|
||||
|
||||
static StructuredProcessRegistration GLProcessRegistration(RDC_OpenGL, &GL_ProcessStructured);
|
||||
static StructuredProcessRegistration GLESProcessRegistration(RDC_OpenGLES, &GL_ProcessStructured);
|
||||
static StructuredProcessRegistration GLProcessRegistration(RDCDriver::OpenGL, &GL_ProcessStructured);
|
||||
static StructuredProcessRegistration GLESProcessRegistration(RDCDriver::OpenGLES,
|
||||
&GL_ProcessStructured);
|
||||
|
||||
#if defined(RENDERDOC_SUPPORT_GL)
|
||||
|
||||
// defined in gl_replay_<platform>.cpp
|
||||
ReplayStatus GL_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver);
|
||||
|
||||
static DriverRegistration GLDriverRegistration(RDC_OpenGL, "OpenGL", &GL_CreateReplayDevice);
|
||||
static DriverRegistration GLDriverRegistration(RDCDriver::OpenGL, &GL_CreateReplayDevice);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3377,6 +3378,6 @@ static DriverRegistration GLDriverRegistration(RDC_OpenGL, "OpenGL", &GL_CreateR
|
||||
ReplayStatus GLES_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver);
|
||||
void GLES_ProcessStructured(RDCFile *rdc, SDFile &output);
|
||||
|
||||
static DriverRegistration GLESDriverRegistration(RDC_OpenGLES, "OpenGLES", &GLES_CreateReplayDevice);
|
||||
static DriverRegistration GLESDriverRegistration(RDCDriver::OpenGLES, &GLES_CreateReplayDevice);
|
||||
|
||||
#endif
|
||||
@@ -155,7 +155,7 @@ ReplayStatus GLES_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
}
|
||||
|
||||
WrappedOpenGL *gl = new WrappedOpenGL(real, GetGLPlatformEGL());
|
||||
gl->SetDriverType(RDC_OpenGLES);
|
||||
gl->SetDriverType(RDCDriver::OpenGLES);
|
||||
gl->Initialise(initParams, ver);
|
||||
|
||||
RDCLOG("Created OPEN GL ES replay device.");
|
||||
|
||||
@@ -879,7 +879,7 @@ void WrappedVulkan::StartFrameCapture(void *dev, void *wnd)
|
||||
if(!IsBackgroundCapturing(m_State))
|
||||
return;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_Vulkan);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::Vulkan);
|
||||
|
||||
m_AppControlledCapture = true;
|
||||
|
||||
|
||||
@@ -5520,7 +5520,7 @@ struct VulkanDriverRegistration
|
||||
{
|
||||
VulkanDriverRegistration()
|
||||
{
|
||||
RenderDoc::Inst().RegisterReplayProvider(RDC_Vulkan, "Vulkan", &Vulkan_CreateReplayDevice);
|
||||
RenderDoc::Inst().RegisterReplayProvider(RDCDriver::Vulkan, &Vulkan_CreateReplayDevice);
|
||||
RenderDoc::Inst().SetVulkanLayerCheck(&VulkanReplay::CheckVulkanLayer);
|
||||
RenderDoc::Inst().SetVulkanLayerInstall(&VulkanReplay::InstallVulkanLayer);
|
||||
}
|
||||
@@ -5544,4 +5544,5 @@ void Vulkan_ProcessStructured(RDCFile *rdc, SDFile &output)
|
||||
vulkan.GetStructuredFile().Swap(output);
|
||||
}
|
||||
|
||||
static StructuredProcessRegistration VulkanProcessRegistration(RDC_Vulkan, &Vulkan_ProcessStructured);
|
||||
static StructuredProcessRegistration VulkanProcessRegistration(RDCDriver::Vulkan,
|
||||
&Vulkan_ProcessStructured);
|
||||
@@ -696,7 +696,7 @@ VkResult WrappedVulkan::vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR
|
||||
GetDebugManager()->BeginText(textstate);
|
||||
|
||||
int flags = activeWindow ? RenderDoc::eOverlay_ActiveWindow : 0;
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDC_Vulkan, m_FrameCounter, flags);
|
||||
string overlayText = RenderDoc::Inst().GetOverlayText(RDCDriver::Vulkan, m_FrameCounter, flags);
|
||||
|
||||
if(!overlayText.empty())
|
||||
GetDebugManager()->RenderText(textstate, 0.0f, 0.0f, overlayText.c_str());
|
||||
@@ -722,7 +722,7 @@ VkResult WrappedVulkan::vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR
|
||||
if(!activeWindow)
|
||||
return vkr;
|
||||
|
||||
RenderDoc::Inst().SetCurrentDriver(RDC_Vulkan);
|
||||
RenderDoc::Inst().SetCurrentDriver(RDCDriver::Vulkan);
|
||||
|
||||
// kill any current capture that isn't application defined
|
||||
if(IsActiveCapturing(m_State) && !m_AppControlledCapture)
|
||||
|
||||
@@ -43,13 +43,13 @@ static void writeToByteVector(void *context, void *data, int size)
|
||||
|
||||
static RDCDriver driverFromName(const char *driverName)
|
||||
{
|
||||
for(int d = RDC_Unknown; d < RDC_MaxBuiltin; d++)
|
||||
for(int d = (int)RDCDriver::Unknown; d < (int)RDCDriver::MaxBuiltin; d++)
|
||||
{
|
||||
if(driverName == ToStr((RDCDriver)d))
|
||||
return (RDCDriver)d;
|
||||
}
|
||||
|
||||
return RDC_Unknown;
|
||||
return RDCDriver::Unknown;
|
||||
}
|
||||
|
||||
static RDCThumb convertThumb(FileType thumbType, uint32_t thumbWidth, uint32_t thumbHeight,
|
||||
@@ -313,7 +313,7 @@ ReplayStatus CaptureFile::Init()
|
||||
}
|
||||
|
||||
// can't open files without a capture in them (except images, which are special)
|
||||
if(driverType != RDC_Image && m_RDC->SectionIndex(SectionType::FrameCapture) == -1)
|
||||
if(driverType != RDCDriver::Image && m_RDC->SectionIndex(SectionType::FrameCapture) == -1)
|
||||
m_Support = ReplaySupport::Unsupported;
|
||||
|
||||
return ReplayStatus::Succeeded;
|
||||
@@ -364,7 +364,7 @@ void CaptureFile::SetMetadata(const char *driverName, uint64_t machineIdent, Fil
|
||||
|
||||
RDCDriver driver = driverFromName(driverName);
|
||||
|
||||
if(driver == RDC_Unknown)
|
||||
if(driver == RDCDriver::Unknown)
|
||||
{
|
||||
RDCERR("Unrecognised driver name '%s'.", driverName);
|
||||
return;
|
||||
|
||||
@@ -170,7 +170,7 @@ struct CaptureMetaData
|
||||
uint64_t machineIdent = 0;
|
||||
|
||||
// the RDCDriver used for this log
|
||||
RDCDriver driverID = RDC_Unknown;
|
||||
RDCDriver driverID = RDCDriver::Unknown;
|
||||
// length in bytes of the driver name
|
||||
uint8_t driverNameLength = 1;
|
||||
// the driver name in ASCII. Useful if the current implementation doesn't recognise the driver
|
||||
@@ -268,7 +268,7 @@ void RDCFile::Open(const char *path)
|
||||
|
||||
if(ret == 1 && x > 0 && y > 0 && comp > 0)
|
||||
{
|
||||
m_Driver = RDC_Image;
|
||||
m_Driver = RDCDriver::Image;
|
||||
m_DriverName = "Image";
|
||||
m_MachineIdent = 0;
|
||||
return;
|
||||
@@ -1130,7 +1130,7 @@ StreamWriter *RDCFile::WriteSection(const SectionProperties &props)
|
||||
|
||||
FILE *RDCFile::StealImageFileHandle(std::string &filename)
|
||||
{
|
||||
if(m_Driver != RDC_Image)
|
||||
if(m_Driver != RDCDriver::Image)
|
||||
{
|
||||
RDCERR("Can't steal image file handle for non-image RDCFile");
|
||||
return NULL;
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
StreamReader *ReadSection(int index) const;
|
||||
StreamWriter *WriteSection(const SectionProperties &props);
|
||||
|
||||
// Only valid if GetDriver returns RDC_Image, passes over the underlying FILE * for use
|
||||
// Only valid if GetDriver returns RDCDriver::Image, passes over the underlying FILE * for use
|
||||
// loading the image directly, since the RDC container isn't there to read from a section.
|
||||
FILE *StealImageFileHandle(std::string &filename);
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
|
||||
uint32_t m_SerVer = 0;
|
||||
|
||||
RDCDriver m_Driver = RDC_Unknown;
|
||||
RDCDriver m_Driver = RDCDriver::Unknown;
|
||||
std::string m_DriverName;
|
||||
uint64_t m_MachineIdent = 0;
|
||||
RDCThumb m_Thumb;
|
||||
|
||||
Reference in new issue
Block a user