Remove INCLUDE_D3D_11_1 and INCLUDE_DXGI_1_2

* There's no longer any reason for them, as dependencies are packed in
  and you don't need the Win 8 SDK installed anymore.
This commit is contained in:
baldurk
2016-02-07 18:51:02 +01:00
parent 74029dc9d9
commit 3f0ef3a37a
19 changed files with 31 additions and 295 deletions
+9 -15
View File
@@ -275,24 +275,20 @@ DXGI_FORMAT MakeDXGIFormat(ResourceFormat fmt)
case eSpecial_R9G9B9E5:
ret = DXGI_FORMAT_R9G9B9E5_SHAREDEXP;
break;
#if defined(INCLUDE_D3D_11_1)
case eSpecial_R4G4B4A4:
RDCASSERT(fmt.bgraOrder);
ret = DXGI_FORMAT_B4G4R4A4_UNORM;
break;
#endif
case eSpecial_D24S8:
ret = DXGI_FORMAT_R24G8_TYPELESS;
break;
case eSpecial_D32S8:
ret = DXGI_FORMAT_R32G8X24_TYPELESS;
break;
#if defined(INCLUDE_D3D_11_1)
case eSpecial_YUV:
RDCERR("Video format not unambiguously encoded");
ret = DXGI_FORMAT_AYUV;
break;
#endif
case eSpecial_S8:
RDCERR("D3D11 has no stencil-only format");
break;
@@ -820,7 +816,6 @@ ResourceFormat MakeResourceFormat(DXGI_FORMAT fmt)
ret.specialFormat = eSpecial_R9G9B9E5;
break;
#if defined(INCLUDE_D3D_11_1)
case DXGI_FORMAT_AYUV:
case DXGI_FORMAT_Y410:
case DXGI_FORMAT_Y416:
@@ -836,6 +831,9 @@ ResourceFormat MakeResourceFormat(DXGI_FORMAT fmt)
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
case DXGI_FORMAT_P208:
case DXGI_FORMAT_V208:
case DXGI_FORMAT_V408:
ret.specialFormat = eSpecial_YUV;
break;
@@ -843,7 +841,6 @@ ResourceFormat MakeResourceFormat(DXGI_FORMAT fmt)
ret.specialFormat = eSpecial_R4G4B4A4;
ret.bgraOrder = true;
break;
#endif
default:
break;
@@ -1579,7 +1576,6 @@ template<> void Serialiser::Serialise(const char *name, D3D11_SUBRESOURCE_DATA &
Serialise("SysMemSlicePitch", el.SysMemSlicePitch);
}
#if defined(INCLUDE_D3D_11_1)
template<>
void Serialiser::Serialise(const char *name, D3D11_BLEND_DESC1 &el)
{
@@ -1630,7 +1626,6 @@ void Serialiser::Serialise(const char *name, D3D11_RASTERIZER_DESC1 &el)
Serialise("AntialiasedLineEnable", el.AntialiasedLineEnable);
Serialise("ForcedSampleCount", el.ForcedSampleCount);
}
#endif
/////////////////////////////////////////////////////////////
// Trivial structures
@@ -2012,9 +2007,9 @@ string ToStrHelper<false, D3D_FEATURE_LEVEL>::Get(const D3D_FEATURE_LEVEL &el)
TOSTR_CASE_STRINGIZE(D3D_FEATURE_LEVEL_10_0)
TOSTR_CASE_STRINGIZE(D3D_FEATURE_LEVEL_10_1)
TOSTR_CASE_STRINGIZE(D3D_FEATURE_LEVEL_11_0)
#if defined(INCLUDE_D3D_11_1)
TOSTR_CASE_STRINGIZE(D3D_FEATURE_LEVEL_11_1)
#endif
TOSTR_CASE_STRINGIZE(D3D_FEATURE_LEVEL_12_0)
TOSTR_CASE_STRINGIZE(D3D_FEATURE_LEVEL_12_1)
default: break;
}
@@ -2166,7 +2161,6 @@ string ToStrHelper<false, D3D11_INPUT_CLASSIFICATION>::Get(const D3D11_INPUT_CLA
return tostrBuf;
}
#if defined(INCLUDE_D3D_11_1)
string ToStrHelper<false, D3D11_LOGIC_OP>::Get(const D3D11_LOGIC_OP &el)
{
switch(el)
@@ -2195,7 +2189,6 @@ string ToStrHelper<false, D3D11_LOGIC_OP>::Get(const D3D11_LOGIC_OP &el)
return tostrBuf;
}
#endif
string ToStrHelper<false, DXGI_FORMAT>::Get(const DXGI_FORMAT &el)
{
@@ -2300,8 +2293,6 @@ string ToStrHelper<false, DXGI_FORMAT>::Get(const DXGI_FORMAT &el)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_BC7_TYPELESS)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_BC7_UNORM)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_BC7_UNORM_SRGB)
#if defined(INCLUDE_D3D_11_1)
// D3D11.1 formats
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_AYUV)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_Y410)
@@ -2319,7 +2310,10 @@ string ToStrHelper<false, DXGI_FORMAT>::Get(const DXGI_FORMAT &el)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_P8)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_A8P8)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_B4G4R4A4_UNORM)
#endif
// D3D11.2 formats
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_P208)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_V208)
TOSTR_CASE_STRINGIZE(DXGI_FORMAT_V408)
default: break;
}
+2 -15
View File
@@ -28,18 +28,8 @@
#define INITGUID
// if you don't have the windows 8.1 SDK, remove this define to exclude the 11.1 functionality
#define INCLUDE_D3D_11_1
#include "official/dxgi.h"
#include "official/d3d11.h"
#if defined(INCLUDE_D3D_11_1)
#include "official/d3d11_1.h"
#include "official/d3d11_2.h"
#else
#define D3D11_1_UAV_SLOT_COUNT 64
#endif
#include "official/dxgi1_3.h"
#include "official/d3d11_3.h"
#include "api/replay/renderdoc_replay.h"
#include "core/core.h"
@@ -154,11 +144,8 @@ template<> void Serialiser::Serialise(const char *name, D3D11_COUNTER_DESC &el);
template<> void Serialiser::Serialise(const char *name, D3D11_INPUT_ELEMENT_DESC &el);
template<> void Serialiser::Serialise(const char *name, D3D11_SO_DECLARATION_ENTRY &el);
template<> void Serialiser::Serialise(const char *name, D3D11_SUBRESOURCE_DATA &el);
#if defined(INCLUDE_D3D_11_1)
template<> void Serialiser::Serialise(const char *name, D3D11_BLEND_DESC1 &el);
template<> void Serialiser::Serialise(const char *name, D3D11_RASTERIZER_DESC1 &el);
#endif
#pragma region Chunks
-25
View File
@@ -37,8 +37,6 @@
WRAPPED_POOL_INST(WrappedID3D11DeviceContext);
WRAPPED_POOL_INST(WrappedID3D11CommandList);
#if defined(INCLUDE_D3D_11_1)
INT STDMETHODCALLTYPE WrappedID3DUserDefinedAnnotation::BeginEvent(LPCWSTR Name)
{
if(m_Context)
@@ -75,7 +73,6 @@ HRESULT STDMETHODCALLTYPE WrappedID3DUserDefinedAnnotation::QueryInterface(REFII
return E_NOINTERFACE;
}
#endif
extern uint32_t NullCBOffsets[D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
extern uint32_t NullCBCounts[D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
@@ -93,7 +90,6 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device* real
NullCBCounts[i] = 4096;
}
#if defined(INCLUDE_D3D_11_1)
D3D11_FEATURE_DATA_D3D11_OPTIONS features;
RDCEraseEl(features);
HRESULT hr = m_pDevice->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS, &features, sizeof(features));
@@ -107,7 +103,6 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device* real
m_pRealContext2 = NULL;
m_pRealContext->QueryInterface(__uuidof(ID3D11DeviceContext2), (void **)&m_pRealContext2);
#endif
#if defined(RELEASE)
const bool debugSerialiser = false;
@@ -152,9 +147,7 @@ WrappedID3D11DeviceContext::WrappedID3D11DeviceContext(WrappedID3D11Device* real
m_CurDrawcallID = 1;
m_MarkerIndentLevel = 0;
#if defined(INCLUDE_D3D_11_1)
m_UserAnnotation.SetContext(this);
#endif
m_CurrentPipelineState = new D3D11RenderState((Serialiser *)NULL);
m_DoStateVerify = m_State >= WRITING;
@@ -193,10 +186,8 @@ WrappedID3D11DeviceContext::~WrappedID3D11DeviceContext()
SAFE_DELETE(m_pSerialiser);
}
#if defined(INCLUDE_D3D_11_1)
SAFE_RELEASE(m_pRealContext1);
SAFE_RELEASE(m_pRealContext2);
#endif
SAFE_DELETE(m_CurrentPipelineState);
SAFE_RELEASE(m_pRealContext);
@@ -845,7 +836,6 @@ void WrappedID3D11DeviceContext::ProcessChunk(uint64_t offset, D3D11ChunkType ch
context->Serialise_End(0x0);
break;
#if defined(INCLUDE_D3D_11_1)
case COPY_SUBRESOURCE_REGION1:
context->Serialise_CopySubresourceRegion1(0x0, 0, 0, 0, 0, 0x0, 0, 0x0, 0);
break;
@@ -874,19 +864,6 @@ void WrappedID3D11DeviceContext::ProcessChunk(uint64_t offset, D3D11ChunkType ch
case SET_CS_CBUFFERS1:
context->Serialise_CSSetConstantBuffers1(0, 0, 0x0, 0x0, 0x0);
break;
#else
case COPY_SUBRESOURCE_REGION1:
case UPDATE_SUBRESOURCE1:
case CLEAR_VIEW:
case SET_VS_CBUFFERS1:
case SET_HS_CBUFFERS1:
case SET_DS_CBUFFERS1:
case SET_GS_CBUFFERS1:
case SET_PS_CBUFFERS1:
case SET_CS_CBUFFERS1:
RDCERR("Replaying log with D3D11.1 events on a build without D3D11.1 support");
break;
#endif
case PUSH_EVENT:
context->Serialise_PushEvent(0, L"");
@@ -1359,7 +1336,6 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11DeviceContext::QueryInterface( REFIID rii
AddRef();
return S_OK;
}
#if defined(INCLUDE_D3D_11_1)
else if(riid == __uuidof(ID3D11DeviceContext1))
{
if(m_pRealContext1)
@@ -1393,7 +1369,6 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11DeviceContext::QueryInterface( REFIID rii
m_UserAnnotation.AddRef();
return S_OK;
}
#endif
else
{
string guid = ToStr::Get(riid);
+1 -19
View File
@@ -71,7 +71,6 @@ struct MapIntercept
class WrappedID3D11DeviceContext;
#if defined(INCLUDE_D3D_11_1)
// ID3DUserDefinedAnnotation
class WrappedID3DUserDefinedAnnotation : public RefCounter, public ID3DUserDefinedAnnotation
{
@@ -94,7 +93,6 @@ class WrappedID3DUserDefinedAnnotation : public RefCounter, public ID3DUserDefin
private:
WrappedID3D11DeviceContext *m_Context;
};
#endif
enum CaptureFailReason
{
@@ -126,13 +124,7 @@ struct DrawcallTreeNode
}
};
#if defined(INCLUDE_D3D_11_1)
#define D3DCONTEXTPARENT ID3D11DeviceContext2
#else
#define D3DCONTEXTPARENT ID3D11DeviceContext
#endif
class WrappedID3D11DeviceContext : public RefCounter, public D3DCONTEXTPARENT
class WrappedID3D11DeviceContext : public RefCounter, public ID3D11DeviceContext2
{
private:
friend class WrappedID3D11DeviceContext;
@@ -171,12 +163,10 @@ private:
WrappedID3D11Device* m_pDevice;
ID3D11DeviceContext* m_pRealContext;
#if defined(INCLUDE_D3D_11_1)
ID3D11DeviceContext1* m_pRealContext1;
bool m_SetCBuffer1;
ID3D11DeviceContext2* m_pRealContext2;
#endif
set<D3D11ResourceRecord *> m_DeferredRecords;
map<ResourceId, int> m_MapResourceRecordAllocs;
@@ -200,9 +190,7 @@ private:
vector<FetchAPIEvent> m_CurEvents, m_Events;
bool m_AddedDrawcall;
#if defined(INCLUDE_D3D_11_1)
WrappedID3DUserDefinedAnnotation m_UserAnnotation;
#endif
int32_t m_MarkerIndentLevel;
struct Annotation
@@ -272,11 +260,7 @@ public:
ID3D11DeviceContext1* GetReal1() { return m_pRealContext1; }
ID3D11DeviceContext2* GetReal2() { return m_pRealContext2; }
#if defined(INCLUDE_D3D_11_1)
bool IsFL11_1();
#else
bool IsFL11_1() { return false; }
#endif
void ProcessChunk(uint64_t offset, D3D11ChunkType chunk, bool forceExecute);
void ReplayFakeContext(ResourceId id);
@@ -858,7 +842,6 @@ public:
UINT SrcDepthPitch,
UINT CopyFlags));
#if defined(INCLUDE_D3D_11_1)
IMPLEMENT_FUNCTION_SERIALISED(virtual void STDMETHODCALLTYPE, CopySubresourceRegion1(
ID3D11Resource *pDstResource,
UINT DstSubresource,
@@ -1028,5 +1011,4 @@ public:
virtual void STDMETHODCALLTYPE BeginEventInt(LPCWSTR pLabel, INT Data);
virtual void STDMETHODCALLTYPE EndEvent();
#endif
};
@@ -146,14 +146,12 @@ bool WrappedID3D11DeviceContext::Serialise_UpdateSubresource1(ID3D11Resource *pD
}
else
{
#if defined(INCLUDE_D3D_11_1)
if(m_pRealContext1)
{
m_pRealContext1->UpdateSubresource1(m_pDevice->GetResourceManager()->UnwrapResource(DestResource), DestSubresource, pBox,
SourceData, SourceRowPitch, SourceDepthPitch, flags);
}
else
#endif
{
RDCERR("Replaying a D3D11.1 context without D3D11.1 available");
m_pDevice->AddDebugMessage(eDbgCategory_Portability, eDbgSeverity_High, eDbgSoruce_UnsupportedConfiguration,
@@ -234,14 +232,12 @@ bool WrappedID3D11DeviceContext::Serialise_UpdateSubresource1(ID3D11Resource *pD
}
else
{
#if defined(INCLUDE_D3D_11_1)
if(m_pRealContext1)
{
m_pRealContext1->UpdateSubresource1(m_pDevice->GetResourceManager()->UnwrapResource(DestResource), DestSubresource, NULL,
bufData, SourceRowPitch, SourceDepthPitch, flags);
}
else
#endif
{
RDCERR("Replaying a D3D11.1 context without D3D11.1 available");
}
@@ -258,7 +254,6 @@ bool WrappedID3D11DeviceContext::Serialise_UpdateSubresource1(ID3D11Resource *pD
void WrappedID3D11DeviceContext::UpdateSubresource1(ID3D11Resource *pDstResource, UINT DstSubresource, const D3D11_BOX *pDstBox,
const void *pSrcData, UINT SrcRowPitch, UINT SrcDepthPitch, UINT CopyFlags)
{
#if defined(INCLUDE_D3D_11_1)
if(m_pRealContext1 == NULL) return;
DrainAnnotationQueue();
@@ -284,12 +279,8 @@ void WrappedID3D11DeviceContext::UpdateSubresource1(ID3D11Resource *pDstResource
m_pRealContext1->UpdateSubresource1(m_pDevice->GetResourceManager()->UnwrapResource(pDstResource), DstSubresource, pDstBox,
pSrcData, SrcRowPitch, SrcDepthPitch, CopyFlags);
#else
return;
#endif
}
#if defined(INCLUDE_D3D_11_1)
bool WrappedID3D11DeviceContext::Serialise_CopySubresourceRegion1(ID3D11Resource *pDstResource, UINT DstSubresource,
UINT DstX, UINT DstY, UINT DstZ,
ID3D11Resource *pSrcResource, UINT SrcSubresource, const D3D11_BOX *pSrcBox, UINT CopyFlags)
@@ -1381,4 +1372,3 @@ void WrappedID3D11DeviceContext::DiscardView1(ID3D11View *pResourceView, const D
if(m_pRealContext1 == NULL) return;
m_pRealContext1->DiscardView1(pResourceView, pRects, NumRects);
}
#endif
@@ -25,8 +25,6 @@
#include "d3d11_context.h"
#if defined(INCLUDE_D3D_11_1)
HRESULT WrappedID3D11DeviceContext::UpdateTileMappings(
ID3D11Resource *pTiledResource,
UINT NumTiledResourceRegions,
@@ -133,5 +131,3 @@ void WrappedID3D11DeviceContext::EndEvent()
{
PopEvent();
}
#endif
+1 -20
View File
@@ -28,7 +28,7 @@
#include "driver/d3d11/d3d11_resources.h"
#include "driver/d3d11/d3d11_renderstate.h"
#include "official/dxgi.h"
#include "official/dxgi1_3.h"
#ifndef DXGI_ERROR_INVALID_CALL
#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)
@@ -2179,14 +2179,12 @@ void WrappedID3D11DeviceContext::RSGetState(ID3D11RasterizerState **ppRasterizer
{
real->Release();
ID3D11DeviceChild *state = m_pDevice->GetResourceManager()->GetWrapper(real);
#if defined(INCLUDE_D3D_11_1)
if(WrappedID3D11RasterizerState1::IsAlloc(state))
{
*ppRasterizerState = (ID3D11RasterizerState *)(ID3D11RasterizerState1 *)state;
(*ppRasterizerState)->AddRef();
}
else
#endif
{
*ppRasterizerState = (ID3D11RasterizerState *)state;
(*ppRasterizerState)->AddRef();
@@ -2300,7 +2298,6 @@ bool WrappedID3D11DeviceContext::Serialise_RSSetState(ID3D11RasterizerState *pRa
if(m_pDevice->GetResourceManager()->HasLiveResource(id))
live = m_pDevice->GetResourceManager()->GetLiveResource(id);
#if defined(INCLUDE_D3D_11_1)
if(WrappedID3D11RasterizerState1::IsAlloc(live))
{
ID3D11RasterizerState1 *state = (ID3D11RasterizerState1 *)live;
@@ -2308,7 +2305,6 @@ bool WrappedID3D11DeviceContext::Serialise_RSSetState(ID3D11RasterizerState *pRa
m_pRealContext->RSSetState((ID3D11RasterizerState *)UNWRAP(WrappedID3D11RasterizerState1, state));
}
else
#endif
{
ID3D11RasterizerState *state = (ID3D11RasterizerState *)live;
m_CurrentPipelineState->ChangeRefRead(m_CurrentPipelineState->RS.State, state);
@@ -2335,7 +2331,6 @@ void WrappedID3D11DeviceContext::RSSetState(ID3D11RasterizerState *pRasterizerSt
m_ContextRecord->AddChunk(scope.Get());
}
#if defined(INCLUDE_D3D_11_1)
RDCASSERT(!pRasterizerState || WrappedID3D11RasterizerState::IsAlloc(pRasterizerState) || WrappedID3D11RasterizerState1::IsAlloc(pRasterizerState));
m_CurrentPipelineState->ChangeRefRead(m_CurrentPipelineState->RS.State, pRasterizerState);
@@ -2343,12 +2338,6 @@ void WrappedID3D11DeviceContext::RSSetState(ID3D11RasterizerState *pRasterizerSt
m_pRealContext->RSSetState(UNWRAP(WrappedID3D11RasterizerState, pRasterizerState));
else
m_pRealContext->RSSetState((ID3D11RasterizerState *)UNWRAP(WrappedID3D11RasterizerState1, pRasterizerState));
#else
RDCASSERT(!pRasterizerState || WrappedID3D11RasterizerState::IsAlloc(pRasterizerState));
m_CurrentPipelineState->ChangeRefRead(m_CurrentPipelineState->RS.State, pRasterizerState);
m_pRealContext->RSSetState(UNWRAP(WrappedID3D11RasterizerState, pRasterizerState));
#endif
VerifyState();
}
@@ -2807,14 +2796,12 @@ void WrappedID3D11DeviceContext::OMGetBlendState(ID3D11BlendState **ppBlendState
if(real != NULL)
{
ID3D11DeviceChild *state = m_pDevice->GetResourceManager()->GetWrapper(real);
#if defined(INCLUDE_D3D_11_1)
if(WrappedID3D11BlendState1::IsAlloc(state))
{
*ppBlendState = (ID3D11BlendState *)(ID3D11BlendState1 *)state;
(*ppBlendState)->AddRef();
}
else
#endif
{
*ppBlendState = (ID3D11BlendState *)state;
(*ppBlendState)->AddRef();
@@ -3254,7 +3241,6 @@ bool WrappedID3D11DeviceContext::Serialise_OMSetBlendState(ID3D11BlendState *pBl
if(m_pDevice->GetResourceManager()->HasLiveResource(State))
live = m_pDevice->GetResourceManager()->GetLiveResource(State);
#if defined(INCLUDE_D3D_11_1)
if(WrappedID3D11BlendState1::IsAlloc(live))
{
ID3D11BlendState1 *state = (ID3D11BlendState1 *)live;
@@ -3262,7 +3248,6 @@ bool WrappedID3D11DeviceContext::Serialise_OMSetBlendState(ID3D11BlendState *pBl
m_pRealContext->OMSetBlendState((ID3D11BlendState *)UNWRAP(WrappedID3D11BlendState1, state), BlendFactor, SampleMask);
}
else
#endif
{
ID3D11BlendState *state = (ID3D11BlendState *)live;
m_CurrentPipelineState->ChangeRefRead(m_CurrentPipelineState->OM.BlendState, state);
@@ -3300,14 +3285,10 @@ void WrappedID3D11DeviceContext::OMSetBlendState(ID3D11BlendState *pBlendState,
m_CurrentPipelineState->Change(m_CurrentPipelineState->OM.BlendFactor, DefaultBlendFactor, 0, 4);
m_CurrentPipelineState->Change(m_CurrentPipelineState->OM.SampleMask, SampleMask);
#if defined(INCLUDE_D3D_11_1)
if(!pBlendState || WrappedID3D11BlendState::IsAlloc(pBlendState))
m_pRealContext->OMSetBlendState(UNWRAP(WrappedID3D11BlendState, pBlendState), BlendFactor, SampleMask);
else
m_pRealContext->OMSetBlendState((ID3D11BlendState *)UNWRAP(WrappedID3D11BlendState1, pBlendState), BlendFactor, SampleMask);
#else
m_pRealContext->OMSetBlendState(UNWRAP(WrappedID3D11BlendState, pBlendState), BlendFactor, SampleMask);
#endif
VerifyState();
}
+1 -1
View File
@@ -26,7 +26,7 @@
#pragma once
#include "official/d3d11.h"
#include "official/d3d11_3.h"
#include <utility>
#include <list>
-21
View File
@@ -261,13 +261,11 @@ WrappedID3D11Device::WrappedID3D11Device(ID3D11Device* realDevice, D3D11InitPara
if(RenderDoc::Inst().GetCrashHandler())
RenderDoc::Inst().GetCrashHandler()->RegisterMemoryRegion(this, sizeof(WrappedID3D11Device));
#if defined(INCLUDE_D3D_11_1)
m_pDevice1 = NULL;
m_pDevice->QueryInterface(__uuidof(ID3D11Device1), (void **)&m_pDevice1);
m_pDevice2 = NULL;
m_pDevice->QueryInterface(__uuidof(ID3D11Device2), (void **)&m_pDevice2);
#endif
m_Replay.SetDevice(this);
@@ -417,10 +415,8 @@ WrappedID3D11Device::~WrappedID3D11Device()
m_CachedStateObjects.clear();
#if defined(INCLUDE_D3D_11_1)
SAFE_RELEASE(m_pDevice1);
SAFE_RELEASE(m_pDevice2);
#endif
SAFE_RELEASE(m_pImmediateContext);
@@ -487,10 +483,8 @@ HRESULT STDMETHODCALLTYPE WrappedID3D11Debug::QueryInterface(REFIID riid, void *
if(riid == __uuidof(ID3D11InfoQueue)
|| riid == __uuidof(ID3D11Debug)
|| riid == __uuidof(ID3D11Device)
#if defined(INCLUDE_D3D_11_1)
|| riid == __uuidof(ID3D11Device1)
|| riid == __uuidof(ID3D11Device2)
#endif
)
return m_pDevice->QueryInterface(riid, ppvObject);
@@ -560,7 +554,6 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject)
return hr;
}
}
#if defined(INCLUDE_DXGI_1_2)
else if(riid == __uuidof(IDXGIDevice2))
{
hr = m_pDevice->QueryInterface(riid, ppvObject);
@@ -593,7 +586,6 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject)
return hr;
}
}
#endif
else if(riid == __uuidof(ID3D11Device))
{
AddRef();
@@ -612,7 +604,6 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject)
*ppvObject = NULL;
return E_NOINTERFACE;
}
#if defined(INCLUDE_D3D_11_1)
else if(riid == __uuidof(ID3D11Device1))
{
if(m_pDevice1)
@@ -646,7 +637,6 @@ HRESULT WrappedID3D11Device::QueryInterface(REFIID riid, void **ppvObject)
*ppvObject = NULL;
return E_NOINTERFACE;
}
#endif
else if(riid == __uuidof(ID3D11InfoQueue))
{
RDCWARN("Returning a dummy ID3D11InfoQueue that does nothing. This ID3D11InfoQueue will not work!");
@@ -786,11 +776,9 @@ vector<DebugMessage> WrappedID3D11Device::GetDebugMessages()
case D3D11_MESSAGE_CATEGORY_EXECUTION:
msg.category = eDbgCategory_Execution;
break;
#if defined(INCLUDE_D3D_11_1)
case D3D11_MESSAGE_CATEGORY_SHADER:
msg.category = eDbgCategory_Shaders;
break;
#endif
default:
RDCWARN("Unexpected message category: %d", message->Category);
break;
@@ -810,11 +798,9 @@ vector<DebugMessage> WrappedID3D11Device::GetDebugMessages()
case D3D11_MESSAGE_SEVERITY_INFO:
msg.severity = eDbgSeverity_Info;
break;
#if defined(INCLUDE_D3D_11_1)
case D3D11_MESSAGE_SEVERITY_MESSAGE:
msg.severity = eDbgSeverity_Info;
break;
#endif
default:
RDCWARN("Unexpected message severity: %d", message->Severity);
break;
@@ -930,19 +916,12 @@ void WrappedID3D11Device::ProcessChunk(uint64_t offset, D3D11ChunkType context)
case CREATE_RASTER_STATE:
Serialise_CreateRasterizerState(0x0, 0x0);
break;
#if defined(INCLUDE_D3D_11_1)
case CREATE_BLEND_STATE1:
Serialise_CreateBlendState1(0x0, 0x0);
break;
case CREATE_RASTER_STATE1:
Serialise_CreateRasterizerState1(0x0, 0x0);
break;
#else
case CREATE_BLEND_STATE1:
case CREATE_RASTER_STATE1:
RDCERR("Replaying log with D3D11.1 events on a build without D3D11.1 support");
break;
#endif
case CREATE_SAMPLER_STATE:
Serialise_CreateSamplerState(0x0, 0x0);
break;
+1 -11
View File
@@ -174,13 +174,7 @@ struct DummyID3D11InfoQueue : public ID3D11InfoQueue
class WrappedID3D11ClassLinkage;
enum CaptureFailReason;
#if defined(INCLUDE_D3D_11_1)
#define D3DDEVICEPARENT ID3D11Device2
#else
#define D3DDEVICEPARENT ID3D11Device
#endif
class WrappedID3D11Device : public IFrameCapturer, public D3DDEVICEPARENT
class WrappedID3D11Device : public IFrameCapturer, public ID3D11Device2
{
private:
// since enumeration creates a lot of devices, save
@@ -209,10 +203,8 @@ private:
D3D11InitParams m_InitParams;
ID3D11Device* m_pDevice;
#if defined(INCLUDE_D3D_11_1)
ID3D11Device1* m_pDevice1;
ID3D11Device2* m_pDevice2;
#endif
ID3D11InfoQueue *m_pInfoQueue;
WrappedID3D11DeviceContext* m_pImmediateContext;
@@ -571,7 +563,6 @@ public:
IMPLEMENT_FUNCTION_SERIALISED(virtual UINT STDMETHODCALLTYPE, GetExceptionMode( void));
#if defined(INCLUDE_D3D_11_1)
//////////////////////////////
// implement ID3D11Device1
@@ -633,5 +624,4 @@ public:
UINT SampleCount,
UINT Flags,
UINT *pNumQualityLevels);
#endif
};
@@ -28,7 +28,6 @@
#include "d3d11_resources.h"
#include "d3d11_context.h"
#if defined(INCLUDE_D3D_11_1)
///////////////////////////////////////////////////////////////////////////////////////////////////////
// ID3D11Device1 interface
@@ -298,5 +297,3 @@ HRESULT WrappedID3D11Device::CheckMultisampleQualityLevels1(
return m_pDevice2->CheckMultisampleQualityLevels1(Format, SampleCount, Flags, pNumQualityLevels);
}
#endif
@@ -81,9 +81,7 @@ bool WrappedID3D11Device::Serialise_CreateBuffer(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
D3D11_SUBRESOURCE_DATA data;
@@ -345,9 +343,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture1D(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
if(HasInitialData)
@@ -446,9 +442,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture2D(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
if(HasInitialData)
@@ -547,9 +541,7 @@ bool WrappedID3D11Device::Serialise_CreateTexture3D(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
if(HasInitialData)
@@ -2536,9 +2528,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
D3D11_SUBRESOURCE_DATA data;
@@ -2615,9 +2605,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
hr = m_pDevice->CreateTexture1D(&Descriptor, NULL, &ret);
@@ -2662,9 +2650,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
hr = m_pDevice->CreateTexture2D(&Descriptor, NULL, &ret);
@@ -2709,9 +2695,7 @@ bool WrappedID3D11Device::Serialise_OpenSharedResource(
Descriptor.MiscFlags &= ~(D3D11_RESOURCE_MISC_SHARED
|D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX
|D3D11_RESOURCE_MISC_GDI_COMPATIBLE
#if defined(INCLUDE_D3D_11_1)
|D3D11_RESOURCE_MISC_SHARED_NTHANDLE
#endif
);
hr = m_pDevice->CreateTexture3D(&Descriptor, NULL, &ret);
-2
View File
@@ -215,9 +215,7 @@ private:
bool suppress = false;
#if defined(INCLUDE_D3D_11_1)
suppress = (Flags & D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY) != 0;
#endif
if(suppress && !reading)
{
@@ -741,35 +741,12 @@ D3D11RenderState::D3D11RenderState(WrappedID3D11DeviceContext *context)
context->PSGetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, PS.Samplers);
context->PSGetShader((ID3D11PixelShader **)&PS.Shader, PS.Instances, &PS.NumInstances);
#if defined(INCLUDE_D3D_11_1)
context->VSGetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, VS.ConstantBuffers, VS.CBOffsets, VS.CBCounts);
context->DSGetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, DS.ConstantBuffers, DS.CBOffsets, DS.CBCounts);
context->HSGetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, HS.ConstantBuffers, HS.CBOffsets, HS.CBCounts);
context->GSGetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, GS.ConstantBuffers, GS.CBOffsets, GS.CBCounts);
context->CSGetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, CS.ConstantBuffers, CS.CBOffsets, CS.CBCounts);
context->PSGetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, PS.ConstantBuffers, PS.CBOffsets, PS.CBCounts);
#else
context->VSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, VS.ConstantBuffers);
context->DSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, DS.ConstantBuffers);
context->HSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, HS.ConstantBuffers);
context->GSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, GS.ConstantBuffers);
context->CSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, CS.ConstantBuffers);
context->PSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, PS.ConstantBuffers);
RDCEraseEl(VS.CBOffsets);
RDCEraseEl(DS.CBOffsets);
RDCEraseEl(HS.CBOffsets);
RDCEraseEl(GS.CBOffsets);
RDCEraseEl(CS.CBOffsets);
RDCEraseEl(PS.CBOffsets);
RDCEraseEl(VS.CBCounts);
RDCEraseEl(DS.CBCounts);
RDCEraseEl(HS.CBCounts);
RDCEraseEl(GS.CBCounts);
RDCEraseEl(CS.CBCounts);
RDCEraseEl(PS.CBCounts);
#endif
// OM
context->OMGetBlendState(&OM.BlendState, OM.BlendFactor, &OM.SampleMask);
@@ -858,21 +835,12 @@ void D3D11RenderState::ApplyState(WrappedID3D11DeviceContext *context)
context->PSSetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, PS.Samplers);
context->PSSetShader((ID3D11PixelShader *)PS.Shader, PS.Instances, PS.NumInstances);
#if defined(INCLUDE_D3D_11_1)
context->VSSetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, VS.ConstantBuffers, VS.CBOffsets, VS.CBCounts);
context->DSSetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, DS.ConstantBuffers, DS.CBOffsets, DS.CBCounts);
context->HSSetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, HS.ConstantBuffers, HS.CBOffsets, HS.CBCounts);
context->GSSetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, GS.ConstantBuffers, GS.CBOffsets, GS.CBCounts);
context->CSSetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, CS.ConstantBuffers, CS.CBOffsets, CS.CBCounts);
context->PSSetConstantBuffers1(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, PS.ConstantBuffers, PS.CBOffsets, PS.CBCounts);
#else
context->VSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, VS.ConstantBuffers);
context->DSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, DS.ConstantBuffers);
context->HSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, HS.ConstantBuffers);
context->GSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, GS.ConstantBuffers);
context->CSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, CS.ConstantBuffers);
context->PSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, PS.ConstantBuffers);
#endif
// OM
context->OMSetBlendState(OM.BlendState, OM.BlendFactor, OM.SampleMask);
-18
View File
@@ -840,7 +840,6 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
ret.m_RS.m_State.SlopeScaledDepthBias = desc.SlopeScaledDepthBias;
ret.m_RS.m_State.ForcedSampleCount = 0;
#if defined(INCLUDE_D3D_11_1)
D3D11_RASTERIZER_DESC1 desc1;
RDCEraseEl(desc1);
@@ -849,7 +848,6 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
((ID3D11RasterizerState1 *)rs->RS.State)->GetDesc1(&desc1);
ret.m_RS.m_State.ForcedSampleCount = desc1.ForcedSampleCount;
}
#endif
ret.m_RS.m_State.State = rm->GetOriginalID(GetIDForResource(rs->RS.State));
}
@@ -1102,7 +1100,6 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
ret.m_OM.m_BlendState.AlphaToCoverage = desc.AlphaToCoverageEnable == TRUE;
ret.m_OM.m_BlendState.IndependentBlend = desc.IndependentBlendEnable == TRUE;
#if defined(INCLUDE_D3D_11_1)
bool state1 = false;
D3D11_BLEND_DESC1 desc1;
RDCEraseEl(desc1);
@@ -1113,7 +1110,6 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
state1 = true;
}
#endif
create_array_uninit(ret.m_OM.m_BlendState.Blends, 8);
for(size_t i=0; i < 8; i++)
@@ -1122,13 +1118,8 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
blend.Enabled = desc.RenderTarget[i].BlendEnable == TRUE;
#if defined(INCLUDE_D3D_11_1)
blend.LogicEnabled = state1 && desc1.RenderTarget[i].LogicOpEnable == TRUE;
blend.LogicOp = state1 ? ToStr::Get(desc1.RenderTarget[i].LogicOp) : "NOOP";
#else
blend.LogicEnabled = false;
blend.LogicOp = "NOOP";
#endif
blend.m_AlphaBlend.Source = ToStr::Get(desc.RenderTarget[i].SrcBlendAlpha);
blend.m_AlphaBlend.Destination = ToStr::Get(desc.RenderTarget[i].DestBlendAlpha);
@@ -1163,13 +1154,8 @@ D3D11PipelineState D3D11Replay::MakePipelineState()
blend.m_Blend.Destination = ToStr::Get(D3D11_BLEND_ZERO);
blend.m_Blend.Operation = ToStr::Get(D3D11_BLEND_OP_ADD);
#if defined(INCLUDE_D3D_11_1)
blend.LogicEnabled = false;
blend.LogicOp = ToStr::Get(D3D11_LOGIC_OP_NOOP);
#else
blend.LogicEnabled = false;
blend.LogicOp = "NOOP";
#endif
blend.WriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
@@ -1891,11 +1877,7 @@ ReplayCreateStatus D3D11_CreateReplayDevice(const char *logfile, IReplayDriver *
int i=-2;
// force using our feature levels as we require >= 11_0 for analysis
#if defined(INCLUDE_D3D_11_1)
D3D_FEATURE_LEVEL featureLevelArray11_1[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0 };
#else
D3D_FEATURE_LEVEL featureLevelArray11_1[] = { D3D_FEATURE_LEVEL_11_0 };
#endif
UINT numFeatureLevels11_1 = ARRAY_COUNT(featureLevelArray11_1);
D3D_FEATURE_LEVEL featureLevelArray11_0[] = { D3D_FEATURE_LEVEL_11_0 };
+9 -12
View File
@@ -52,10 +52,8 @@ WRAPPED_POOL_INST(WrappedID3D11Query);
WRAPPED_POOL_INST(WrappedID3D11Predicate);
WRAPPED_POOL_INST(WrappedID3D11ClassInstance);
WRAPPED_POOL_INST(WrappedID3D11ClassLinkage);
#if defined(INCLUDE_D3D_11_1)
WRAPPED_POOL_INST(WrappedID3D11RasterizerState1);
WRAPPED_POOL_INST(WrappedID3D11BlendState1);
#endif
map<ResourceId,WrappedID3D11Texture1D::TextureEntry> WrappedTexture<ID3D11Texture1D, D3D11_TEXTURE1D_DESC>::m_TextureList;
map<ResourceId,WrappedID3D11Texture2D::TextureEntry> WrappedTexture<ID3D11Texture2D, D3D11_TEXTURE2D_DESC>::m_TextureList;
@@ -277,7 +275,6 @@ UINT GetFormatBPP(DXGI_FORMAT f)
ret *= 16;
break;
#if defined(INCLUDE_D3D_11_1)
case DXGI_FORMAT_AYUV:
case DXGI_FORMAT_Y410:
case DXGI_FORMAT_YUY2:
@@ -293,13 +290,15 @@ UINT GetFormatBPP(DXGI_FORMAT f)
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
case DXGI_FORMAT_P208:
case DXGI_FORMAT_V208:
case DXGI_FORMAT_V408:
RDCERR("Video formats not supported");
break;
case DXGI_FORMAT_B4G4R4A4_UNORM:
ret *= 2; // 4 channels, half a byte each
break;
#endif
default:
RDCFATAL("Unrecognised DXGI Format: %d", f);
@@ -438,7 +437,6 @@ UINT GetByteSize(int Width, int Height, int Depth, DXGI_FORMAT Format, int mip)
RDCMAX(Depth>>mip,1);
ret *= 1;
break;
#if defined(INCLUDE_D3D_11_1)
case DXGI_FORMAT_AYUV:
case DXGI_FORMAT_Y410:
case DXGI_FORMAT_YUY2:
@@ -454,13 +452,15 @@ UINT GetByteSize(int Width, int Height, int Depth, DXGI_FORMAT Format, int mip)
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
case DXGI_FORMAT_P208:
case DXGI_FORMAT_V208:
case DXGI_FORMAT_V408:
RDCERR("Video formats not supported");
break;
case DXGI_FORMAT_B4G4R4A4_UNORM:
ret *= 2; // 4 channels, half a byte each
break;
#endif
default:
RDCFATAL("Unrecognised DXGI Format: %d", Format);
break;
@@ -1325,7 +1325,6 @@ DXGI_FORMAT GetTypelessFormat(DXGI_FORMAT f)
case DXGI_FORMAT_BC7_UNORM_SRGB:
return DXGI_FORMAT_BC7_TYPELESS;
#if defined(INCLUDE_D3D_11_1)
case DXGI_FORMAT_R1_UNORM:
case DXGI_FORMAT_R9G9B9E5_SHAREDEXP:
case DXGI_FORMAT_B5G6R5_UNORM:
@@ -1346,10 +1345,12 @@ DXGI_FORMAT GetTypelessFormat(DXGI_FORMAT f)
case DXGI_FORMAT_IA44:
case DXGI_FORMAT_P8:
case DXGI_FORMAT_A8P8:
case DXGI_FORMAT_P208:
case DXGI_FORMAT_V208:
case DXGI_FORMAT_V408:
case DXGI_FORMAT_B4G4R4A4_UNORM:
RDCERR("No Typeless DXGI Format for %d", f);
return DXGI_FORMAT_UNKNOWN;
#endif
default:
RDCFATAL("Unrecognised DXGI Format: %d", f);
@@ -1432,12 +1433,10 @@ ResourceId GetIDForResource(ID3D11DeviceChild *ptr)
return ((WrappedID3D11DepthStencilState *)ptr)->GetResourceID();
if(WrappedID3D11SamplerState::IsAlloc(ptr))
return ((WrappedID3D11SamplerState *)ptr)->GetResourceID();
#if defined(INCLUDE_D3D_11_1)
if(WrappedID3D11RasterizerState1::IsAlloc(ptr))
return ((WrappedID3D11RasterizerState1 *)ptr)->GetResourceID();
if(WrappedID3D11BlendState1::IsAlloc(ptr))
return ((WrappedID3D11BlendState1 *)ptr)->GetResourceID();
#endif
if(WrappedID3D11RenderTargetView::IsAlloc(ptr))
return ((WrappedID3D11RenderTargetView *)ptr)->GetResourceID();
@@ -1501,12 +1500,10 @@ ResourceType IdentifyTypeByPtr(IUnknown *ptr)
return Resource_DepthStencilState;
if(WrappedID3D11SamplerState::IsAlloc(ptr))
return Resource_SamplerState;
#if defined(INCLUDE_D3D_11_1)
if(WrappedID3D11RasterizerState1::IsAlloc(ptr))
return Resource_RasterizerState1;
if(WrappedID3D11BlendState1::IsAlloc(ptr))
return Resource_BlendState1;
#endif
if(WrappedID3D11RenderTargetView::IsAlloc(ptr))
return Resource_RenderTargetView;
+1 -18
View File
@@ -109,14 +109,7 @@ class TrackedResource
};
template<typename NestedType>
class WrappedDXGIInterface : public RefCounter, public IDXGIKeyedMutex
#if defined(INCLUDE_D3D_11_1)
, public IDXGISurface2
, public IDXGIResource1
#else
, public IDXGISurface1
, public IDXGIResource
#endif
class WrappedDXGIInterface : public RefCounter, public IDXGIKeyedMutex, public IDXGISurface2, public IDXGIResource1
{
public:
WrappedID3D11Device* m_pDevice;
@@ -192,7 +185,6 @@ public:
AddRef();
return S_OK;
}
#if defined(INCLUDE_D3D_11_1)
if(riid == __uuidof(IDXGIResource1))
{
*ppvObject = (IDXGIResource1 *)this;
@@ -205,7 +197,6 @@ public:
AddRef();
return S_OK;
}
#endif
return m_pWrapped->QueryInterface(riid, ppvObject);
}
@@ -421,7 +412,6 @@ public:
return hr;
}
#if defined(INCLUDE_D3D_11_1)
//////////////////////////////
// Implement IDXGIResource1
virtual HRESULT STDMETHODCALLTYPE CreateSubresourceSurface(UINT index, IDXGISurface2 **ppSurface)
@@ -458,7 +448,6 @@ public:
if(pSubresourceIndex) pSubresourceIndex = 0;
return QueryInterface(riid, ppParentResource);
}
#endif
};
template<typename NestedType>
@@ -545,10 +534,8 @@ public:
|| riid == __uuidof(IDXGIKeyedMutex)
|| riid == __uuidof(IDXGISurface)
|| riid == __uuidof(IDXGISurface1)
#if defined(INCLUDE_D3D_11_1)
|| riid == __uuidof(IDXGIResource1)
|| riid == __uuidof(IDXGISurface2)
#endif
)
{
// ensure the real object has this interface
@@ -574,10 +561,8 @@ public:
else if(riid == __uuidof(IDXGIKeyedMutex)) *ppvObject = (IDXGIKeyedMutex *)dxgiWrapper;
else if(riid == __uuidof(IDXGISurface)) *ppvObject = (IDXGISurface *)dxgiWrapper;
else if(riid == __uuidof(IDXGISurface1)) *ppvObject = (IDXGISurface1 *)dxgiWrapper;
#if defined(INCLUDE_D3D_11_1)
else if(riid == __uuidof(IDXGIResource1)) *ppvObject = (IDXGIResource1 *)dxgiWrapper;
else if(riid == __uuidof(IDXGISurface2)) *ppvObject = (IDXGISurface2 *)dxgiWrapper;
#endif
return S_OK;
}
@@ -1422,7 +1407,6 @@ public:
}
};
#if defined(INCLUDE_D3D_11_1)
class WrappedID3D11RasterizerState1 : public WrappedDeviceChild<ID3D11RasterizerState1>
{
public:
@@ -1474,4 +1458,3 @@ public:
m_pReal->GetDesc1(pDesc);
}
};
#endif
+3 -28
View File
@@ -34,10 +34,8 @@
WRAPPED_POOL_INST(WrappedIDXGIDevice);
WRAPPED_POOL_INST(WrappedIDXGIDevice1);
#if defined(INCLUDE_DXGI_1_2)
WRAPPED_POOL_INST(WrappedIDXGIDevice2);
WRAPPED_POOL_INST(WrappedIDXGIDevice3);
#endif
HRESULT WrappedIDXGIFactory::staticCreateSwapChain(IDXGIFactory *factory,
IUnknown *pDevice,
@@ -46,11 +44,9 @@ HRESULT WrappedIDXGIFactory::staticCreateSwapChain(IDXGIFactory *factory,
{
if(WrappedID3D11Device::IsAlloc(pDevice) ||
WrappedIDXGIDevice::IsAlloc(pDevice) ||
WrappedIDXGIDevice1::IsAlloc(pDevice)
#if defined(INCLUDE_DXGI_1_2)
|| WrappedIDXGIDevice2::IsAlloc(pDevice)
|| WrappedIDXGIDevice3::IsAlloc(pDevice)
#endif
WrappedIDXGIDevice1::IsAlloc(pDevice) ||
WrappedIDXGIDevice2::IsAlloc(pDevice) ||
WrappedIDXGIDevice3::IsAlloc(pDevice)
)
{
WrappedID3D11Device *wrapDevice = (WrappedID3D11Device *)pDevice;
@@ -59,12 +55,10 @@ HRESULT WrappedIDXGIFactory::staticCreateSwapChain(IDXGIFactory *factory,
wrapDevice = (WrappedID3D11Device *)((WrappedIDXGIDevice *)(IDXGIDevice *)pDevice)->GetD3DDevice();
if(WrappedIDXGIDevice1::IsAlloc(pDevice))
wrapDevice = (WrappedID3D11Device *)((WrappedIDXGIDevice1 *)(IDXGIDevice1 *)pDevice)->GetD3DDevice();
#if defined(INCLUDE_DXGI_1_2)
if(WrappedIDXGIDevice2::IsAlloc(pDevice))
wrapDevice = (WrappedID3D11Device *)((WrappedIDXGIDevice2 *)(IDXGIDevice2 *)pDevice)->GetD3DDevice();
if(WrappedIDXGIDevice3::IsAlloc(pDevice))
wrapDevice = (WrappedID3D11Device *)((WrappedIDXGIDevice3 *)(IDXGIDevice3 *)pDevice)->GetD3DDevice();
#endif
if(!RenderDoc::Inst().GetCaptureOptions().AllowFullscreen && pDesc)
{
@@ -86,8 +80,6 @@ HRESULT WrappedIDXGIFactory::staticCreateSwapChain(IDXGIFactory *factory,
return factory->CreateSwapChain(pDevice, pDesc, ppSwapChain);
}
#if defined(INCLUDE_DXGI_1_2)
HRESULT WrappedIDXGIFactory2::staticCreateSwapChainForHwnd( IDXGIFactory2 *factory,
IUnknown *pDevice,
HWND hWnd,
@@ -231,7 +223,6 @@ HRESULT WrappedIDXGIFactory2::staticCreateSwapChainForComposition( IDXGIFactory2
return factory->CreateSwapChainForComposition(pDevice, pDesc, pRestrictToOutput, ppSwapChain);
}
#endif
WrappedIDXGISwapChain2::WrappedIDXGISwapChain2(IDXGISwapChain* real, HWND wnd, WrappedID3D11Device *device)
: RefCountDXGIObject(real), m_pReal(real), m_pDevice(device), m_iRefcount(1), m_Wnd(wnd)
@@ -239,12 +230,10 @@ WrappedIDXGISwapChain2::WrappedIDXGISwapChain2(IDXGISwapChain* real, HWND wnd, W
DXGI_SWAP_CHAIN_DESC desc;
real->GetDesc(&desc);
#if defined(INCLUDE_DXGI_1_2)
m_pReal1 = NULL;
real->QueryInterface(__uuidof(IDXGISwapChain1), (void **)&m_pReal1);
m_pReal2 = NULL;
real->QueryInterface(__uuidof(IDXGISwapChain2), (void **)&m_pReal2);
#endif
int bufCount = desc.BufferCount;
@@ -290,10 +279,8 @@ WrappedIDXGISwapChain2::~WrappedIDXGISwapChain2()
wrapped->ViewRelease();
m_pBackBuffers[i] = NULL;
}
#if defined(INCLUDE_DXGI_1_2)
SAFE_RELEASE(m_pReal1);
SAFE_RELEASE(m_pReal2);
#endif
SAFE_RELEASE(m_pReal);
SAFE_RELEASE(m_pDevice);
@@ -479,7 +466,6 @@ HRESULT WrappedIDXGISwapChain2::Present(
return m_pReal->Present(SyncInterval, Flags);
}
#if defined(INCLUDE_DXGI_1_2)
HRESULT WrappedIDXGISwapChain2::Present1(UINT SyncInterval, UINT Flags, const DXGI_PRESENT_PARAMETERS *pPresentParameters)
{
if(!RenderDoc::Inst().GetCaptureOptions().AllowVSync)
@@ -491,7 +477,6 @@ HRESULT WrappedIDXGISwapChain2::Present1(UINT SyncInterval, UINT Flags, const DX
return m_pReal1->Present1(SyncInterval, Flags, pPresentParameters);
}
#endif
bool RefCountDXGIObject::HandleWrap(REFIID riid, void **ppvObject)
{
@@ -544,7 +529,6 @@ bool RefCountDXGIObject::HandleWrap(REFIID riid, void **ppvObject)
*ppvObject = new WrappedIDXGIFactory1(real);
return true;
}
#if defined(INCLUDE_DXGI_1_2)
else if(riid == __uuidof(IDXGIAdapter2))
{
IDXGIAdapter2 *real = (IDXGIAdapter2 *)(*ppvObject);
@@ -563,7 +547,6 @@ bool RefCountDXGIObject::HandleWrap(REFIID riid, void **ppvObject)
*ppvObject = new WrappedIDXGIFactory3(real);
return true;
}
#endif
else
{
string guid = ToStr::Get(riid);
@@ -603,7 +586,6 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain2::QueryInterface(REFIID riid, vo
*ppvObject = (IDXGISwapChain *)this;
return S_OK;
}
#if defined(INCLUDE_DXGI_1_2)
else if(riid == __uuidof(IDXGISwapChain1))
{
if(m_pReal1)
@@ -630,7 +612,6 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGISwapChain2::QueryInterface(REFIID riid, vo
return E_NOINTERFACE;
}
}
#endif
else
{
string guid = ToStr::Get(riid);
@@ -673,7 +654,6 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGIDevice1::QueryInterface( REFIID riid, void
*ppvObject = (IDXGIDevice1 *)this;
return S_OK;
}
#if defined(INCLUDE_DXGI_1_2)
else if(riid == __uuidof(IDXGIDevice2))
{
hr = m_pReal->QueryInterface(riid, ppvObject);
@@ -704,7 +684,6 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGIDevice1::QueryInterface( REFIID riid, void
return E_NOINTERFACE;
}
}
#endif
else
{
string guid = ToStr::Get(riid);
@@ -714,8 +693,6 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGIDevice1::QueryInterface( REFIID riid, void
return RefCountDXGIObject::QueryInterface(riid, ppvObject);
}
#if defined(INCLUDE_DXGI_1_2)
HRESULT STDMETHODCALLTYPE WrappedIDXGIDevice2::QueryInterface( REFIID riid, void **ppvObject )
{
if(riid == __uuidof(ID3D11Device))
@@ -795,5 +772,3 @@ HRESULT STDMETHODCALLTYPE WrappedIDXGIDevice3::QueryInterface( REFIID riid, void
return RefCountDXGIObject::QueryInterface(riid, ppvObject);
}
#endif
+3 -25
View File
@@ -26,11 +26,8 @@
#pragma once
#include "../d3d11/official/dxgi.h"
#include "../d3d11/official/d3d11.h"
// if you don't have the windows 8.1 SDK, remove this define to exclude the DXGI1.2+ functionality
#define INCLUDE_DXGI_1_2
#include "../d3d11/official/dxgi1_3.h"
#include "../d3d11/official/d3d11_3.h"
#include "common/common.h"
#include "common/wrapped_pool.h"
@@ -102,24 +99,11 @@ public:
class WrappedID3D11Device;
struct ID3D11Resource;
#if defined(INCLUDE_DXGI_1_2)
#include "../d3d11/official/dxgi1_2.h"
#include "../d3d11/official/dxgi1_3.h"
#endif
#if defined(INCLUDE_DXGI_1_2)
#define SWAPCHAINPARENT IDXGISwapChain2
#else
#define SWAPCHAINPARENT IDXGISwapChain
#endif
class WrappedIDXGISwapChain2 : public SWAPCHAINPARENT, public RefCountDXGIObject
class WrappedIDXGISwapChain2 : public IDXGISwapChain2, public RefCountDXGIObject
{
IDXGISwapChain* m_pReal;
#if defined(INCLUDE_DXGI_1_2)
IDXGISwapChain1* m_pReal1;
IDXGISwapChain2* m_pReal2;
#endif
WrappedID3D11Device *m_pDevice;
unsigned int m_iRefcount;
@@ -199,7 +183,6 @@ public:
return m_pReal->GetLastPresentCount(pLastPresentCount);
}
#if defined(INCLUDE_DXGI_1_2)
//////////////////////////////
// implement IDXGISwapChain1
@@ -328,7 +311,6 @@ public:
{
return m_pReal2->GetMatrixTransform(pMatrix);
}
#endif
};
//////////////////////////////////////////////////////////////////////////////
@@ -711,8 +693,6 @@ public:
}
};
#if defined(INCLUDE_DXGI_1_2)
class WrappedIDXGIDevice2 : public IDXGIDevice2, public RefCountDXGIObject
{
IDXGIDevice2* m_pReal;
@@ -1458,5 +1438,3 @@ public:
return m_pReal->GetCreationFlags();
}
};
#endif