mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Update D3D8 and D3D9 stub projects to new code
This commit is contained in:
@@ -52,8 +52,7 @@ WrappedD3DDevice8::WrappedD3DDevice8(IDirect3DDevice8 *device, HWND wnd,
|
||||
|
||||
if(!RenderDoc::Inst().IsReplayApp())
|
||||
{
|
||||
m_State = READING;
|
||||
m_pSerialiser = NULL;
|
||||
m_State = CaptureState::BackgroundCapturing;
|
||||
|
||||
RenderDoc::Inst().AddDeviceFrameCapturer((IDirect3DDevice8 *)this, this);
|
||||
|
||||
@@ -64,13 +63,10 @@ WrappedD3DDevice8::WrappedD3DDevice8(IDirect3DDevice8 *device, HWND wnd,
|
||||
}
|
||||
else
|
||||
{
|
||||
m_State = WRITING_IDLE;
|
||||
m_pSerialiser = new Serialiser(NULL, Serialiser::WRITING, debugSerialiser);
|
||||
|
||||
m_pSerialiser->SetDebugText(true);
|
||||
m_State = CaptureState::LoadingReplaying;
|
||||
}
|
||||
|
||||
m_ResourceManager = new D3D8ResourceManager(m_State, m_pSerialiser, this);
|
||||
m_ResourceManager = new D3D8ResourceManager(this);
|
||||
}
|
||||
|
||||
void WrappedD3DDevice8::CheckForDeath()
|
||||
@@ -105,8 +101,6 @@ WrappedD3DDevice8::~WrappedD3DDevice8()
|
||||
|
||||
SAFE_RELEASE(m_device);
|
||||
|
||||
SAFE_DELETE(m_pSerialiser);
|
||||
|
||||
RDCASSERT(WrappedIDirect3DVertexBuffer8::m_BufferList.empty());
|
||||
RDCASSERT(WrappedIDirect3DIndexBuffer8::m_BufferList.empty());
|
||||
}
|
||||
@@ -127,7 +121,7 @@ void WrappedD3DDevice8::ReleaseResource(IDirect3DResource8 *res)
|
||||
|
||||
// wrapped resources get released all the time, we don't want to
|
||||
// try and slerp in a resource release. Just the explicit ones
|
||||
if(m_State < WRITING)
|
||||
if(IsReplayMode(m_State))
|
||||
{
|
||||
if(GetResourceManager()->HasLiveResource(id))
|
||||
GetResourceManager()->EraseLiveResource(id);
|
||||
@@ -356,7 +350,7 @@ HRESULT __stdcall WrappedD3DDevice8::CreateVertexBuffer(UINT Length, DWORD Usage
|
||||
|
||||
wrapped = new WrappedIDirect3DVertexBuffer8(real, Length, this);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
// TODO: Serialise
|
||||
}
|
||||
@@ -387,7 +381,7 @@ HRESULT __stdcall WrappedD3DDevice8::CreateIndexBuffer(UINT Length, DWORD Usage,
|
||||
|
||||
wrapped = new WrappedIDirect3DIndexBuffer8(real, Length, this);
|
||||
|
||||
if(m_State >= WRITING)
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
// TODO: Serialise
|
||||
}
|
||||
|
||||
@@ -220,8 +220,7 @@ private:
|
||||
// protects wrapped resource creation and serialiser access
|
||||
Threading::CriticalSection m_D3DLock;
|
||||
|
||||
Serialiser *m_pSerialiser;
|
||||
LogState m_State;
|
||||
CaptureState m_State;
|
||||
|
||||
unsigned int m_InternalRefcount;
|
||||
RefCounter8 m_RefCounter;
|
||||
|
||||
@@ -61,7 +61,13 @@ bool D3D8ResourceManager::Prepare_InitialState(IUnknown *res)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool D3D8ResourceManager::Serialise_InitialState(ResourceId id, IUnknown *res)
|
||||
uint32_t D3D8ResourceManager::GetSize_InitialState(ResourceId id, IUnknown *res)
|
||||
{
|
||||
// TODO
|
||||
return 128;
|
||||
}
|
||||
|
||||
bool D3D8ResourceManager::Serialise_InitialState(WriteSerialiser &ser, ResourceId id, IUnknown *res)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
|
||||
@@ -51,11 +51,7 @@ struct D3D8ResourceRecord : public ResourceRecord
|
||||
class D3D8ResourceManager : public ResourceManager<IUnknown *, IUnknown *, D3D8ResourceRecord>
|
||||
{
|
||||
public:
|
||||
D3D8ResourceManager(LogState state, Serialiser *ser, WrappedD3DDevice8 *dev)
|
||||
: ResourceManager(state, ser), m_Device(dev)
|
||||
{
|
||||
}
|
||||
|
||||
D3D8ResourceManager(WrappedD3DDevice8 *dev) : m_Device(dev) {}
|
||||
private:
|
||||
bool SerialisableResource(ResourceId id, D3D8ResourceRecord *record);
|
||||
ResourceId GetID(IUnknown *res);
|
||||
@@ -65,7 +61,8 @@ private:
|
||||
bool Force_InitialState(IUnknown *res, bool prepare);
|
||||
bool Need_InitialStateChunk(IUnknown *res);
|
||||
bool Prepare_InitialState(IUnknown *res);
|
||||
bool Serialise_InitialState(ResourceId resid, IUnknown *res);
|
||||
uint32_t GetSize_InitialState(ResourceId id, IUnknown *res);
|
||||
bool Serialise_InitialState(WriteSerialiser &ser, ResourceId resid, IUnknown *res);
|
||||
void Create_InitialState(ResourceId id, IUnknown *live, bool hasData);
|
||||
void Apply_InitialState(IUnknown *live, InitialContentData data);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "d3d8_common.h"
|
||||
|
||||
ReplayStatus D3D8_CreateReplayDevice(const char *logfile, IReplayDriver **driver)
|
||||
ReplayStatus D3D8_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
{
|
||||
RDCERR("D3D8 captures are not currently supported");
|
||||
return ReplayStatus::APIUnsupported;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "d3d9_common.h"
|
||||
|
||||
ReplayStatus D3D9_CreateReplayDevice(const char *logfile, IReplayDriver **driver)
|
||||
ReplayStatus D3D9_CreateReplayDevice(RDCFile *rdc, IReplayDriver **driver)
|
||||
{
|
||||
RDCERR("D3D9 captures are not currently supported");
|
||||
return ReplayStatus::APIUnsupported;
|
||||
|
||||
Reference in New Issue
Block a user