mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-13 17:25:54 +00:00
Check for File I/O failures when opening log in replay driver.
* I got a crash report that seemed to have a file become invalid or unavailable in between it being opened to determine the driver (which already handles I/O failures) and the driver opening it. This check just makes that more robust
This commit is contained in:
@@ -2066,6 +2066,12 @@ ReplayCreateStatus D3D11_CreateReplayDevice(const char *logfile, IReplayDriver *
|
||||
wrappedDev->SetLogFile(logfile);
|
||||
wrappedDev->SetLogVersion(initParams.SerialiseVersion);
|
||||
|
||||
if(wrappedDev->GetSerialiser()->HasError())
|
||||
{
|
||||
SAFE_RELEASE(wrappedDev);
|
||||
return eReplayCreate_FileIOFailed;
|
||||
}
|
||||
|
||||
RDCLOG("Created device.");
|
||||
D3D11Replay *replay = wrappedDev->GetReplay();
|
||||
|
||||
|
||||
@@ -1538,6 +1538,12 @@ ReplayCreateStatus D3D12_CreateReplayDevice(const char *logfile, IReplayDriver *
|
||||
wrappedDev->SetLogFile(logfile);
|
||||
wrappedDev->SetLogVersion(initParams.SerialiseVersion);
|
||||
|
||||
if(wrappedDev->GetSerialiser()->HasError())
|
||||
{
|
||||
SAFE_RELEASE(wrappedDev);
|
||||
return eReplayCreate_FileIOFailed;
|
||||
}
|
||||
|
||||
RDCLOG("Created device.");
|
||||
D3D12Replay *replay = wrappedDev->GetReplay();
|
||||
|
||||
|
||||
@@ -330,7 +330,6 @@ private:
|
||||
|
||||
ResourceId m_FakeVAOID;
|
||||
|
||||
Serialiser *GetSerialiser() { return m_pSerialiser; }
|
||||
uint32_t GetLogVersion() { return m_InitParams.SerialiseVersion; }
|
||||
void ProcessChunk(uint64_t offset, GLChunkType context);
|
||||
void ContextReplayLog(LogState readType, uint32_t startEventID, uint32_t endEventID, bool partial);
|
||||
@@ -504,6 +503,7 @@ public:
|
||||
void ReplayLog(uint32_t startEventID, uint32_t endEventID, ReplayLogType replayType);
|
||||
void ReadLogInitialisation();
|
||||
|
||||
Serialiser *GetSerialiser() { return m_pSerialiser; }
|
||||
GLuint GetFakeBBFBO() { return m_FakeBB_FBO; }
|
||||
GLuint GetFakeVAO() { return m_FakeVAO; }
|
||||
FetchFrameRecord &GetFrameRecord() { return m_FrameRecord; }
|
||||
|
||||
@@ -433,6 +433,12 @@ ReplayCreateStatus GL_CreateReplayDevice(const char *logfile, IReplayDriver **dr
|
||||
WrappedOpenGL *gl = new WrappedOpenGL(logfile, GetRealGLFunctions());
|
||||
gl->Initialise(initParams);
|
||||
|
||||
if(gl->GetSerialiser()->HasError())
|
||||
{
|
||||
delete gl;
|
||||
return eReplayCreate_FileIOFailed;
|
||||
}
|
||||
|
||||
RDCLOG("Created device.");
|
||||
GLReplay *replay = gl->GetReplay();
|
||||
replay->SetProxy(logfile == NULL);
|
||||
|
||||
@@ -805,6 +805,12 @@ ReplayCreateStatus GL_CreateReplayDevice(const char *logfile, IReplayDriver **dr
|
||||
WrappedOpenGL *gl = new WrappedOpenGL(logfile, real);
|
||||
gl->Initialise(initParams);
|
||||
|
||||
if(gl->GetSerialiser()->HasError())
|
||||
{
|
||||
delete gl;
|
||||
return eReplayCreate_FileIOFailed;
|
||||
}
|
||||
|
||||
RDCLOG("Created device.");
|
||||
GLReplay *replay = gl->GetReplay();
|
||||
replay->SetProxy(logfile == NULL);
|
||||
|
||||
@@ -84,6 +84,9 @@ static void StripUnwantedLayers(vector<string> &Layers)
|
||||
|
||||
ReplayCreateStatus WrappedVulkan::Initialise(VkInitParams ¶ms)
|
||||
{
|
||||
if(m_pSerialiser->HasError())
|
||||
return eReplayCreate_FileIOFailed;
|
||||
|
||||
m_InitParams = params;
|
||||
|
||||
params.AppName = string("RenderDoc @ ") + params.AppName;
|
||||
|
||||
Reference in New Issue
Block a user