mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d11] stub implementation of ID3D11Device1 (#175)
This commit is contained in:
parent
a3e7139c1e
commit
043982d3be
@ -56,6 +56,7 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE D3D11Device::QueryInterface(REFIID riid, void** ppvObject) {
|
HRESULT STDMETHODCALLTYPE D3D11Device::QueryInterface(REFIID riid, void** ppvObject) {
|
||||||
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
||||||
COM_QUERY_IFACE(riid, ppvObject, ID3D11Device);
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Device);
|
||||||
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Device1);
|
||||||
|
|
||||||
if (riid == __uuidof(IDXGIDevice)
|
if (riid == __uuidof(IDXGIDevice)
|
||||||
|| riid == __uuidof(IDXGIDevice1)
|
|| riid == __uuidof(IDXGIDevice1)
|
||||||
@ -1105,6 +1106,14 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D11Device::CreateBlendState1(
|
||||||
|
const D3D11_BLEND_DESC1* pBlendStateDesc,
|
||||||
|
ID3D11BlendState1** ppBlendState) {
|
||||||
|
Logger::err("D3D11Device::CreateBlendState1: Not implemented");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDepthStencilState(
|
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDepthStencilState(
|
||||||
const D3D11_DEPTH_STENCIL_DESC* pDepthStencilDesc,
|
const D3D11_DEPTH_STENCIL_DESC* pDepthStencilDesc,
|
||||||
ID3D11DepthStencilState** ppDepthStencilState) {
|
ID3D11DepthStencilState** ppDepthStencilState) {
|
||||||
@ -1162,6 +1171,12 @@ namespace dxvk {
|
|||||||
} return S_FALSE;
|
} return S_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT D3D11Device::CreateRasterizerState1(
|
||||||
|
const D3D11_RASTERIZER_DESC1* pRasterizerDesc,
|
||||||
|
ID3D11RasterizerState1** ppRasterizerState) {
|
||||||
|
Logger::err("D3D11Device::CreateRasterizerState1: Not implemented");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11Device::CreateSamplerState(
|
HRESULT STDMETHODCALLTYPE D3D11Device::CreateSamplerState(
|
||||||
const D3D11_SAMPLER_DESC* pSamplerDesc,
|
const D3D11_SAMPLER_DESC* pSamplerDesc,
|
||||||
@ -1244,6 +1259,24 @@ namespace dxvk {
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDeferredContext1(
|
||||||
|
UINT ContextFlags,
|
||||||
|
ID3D11DeviceContext1** ppDeferredContext) {
|
||||||
|
*ppDeferredContext = ref(new D3D11DeferredContext(this, m_dxvkDevice, ContextFlags));
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDeviceContextState(
|
||||||
|
UINT Flags,
|
||||||
|
const D3D_FEATURE_LEVEL* pFeatureLevels,
|
||||||
|
UINT FeatureLevels,
|
||||||
|
UINT SDKVersion,
|
||||||
|
REFIID EmulatedInterface,
|
||||||
|
D3D_FEATURE_LEVEL* pChosenFeatureLevel,
|
||||||
|
ID3DDeviceContextState** ppContextState) {
|
||||||
|
Logger::err("D3D11Device::CreateDeviceContextState: Not implemented");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11Device::OpenSharedResource(
|
HRESULT STDMETHODCALLTYPE D3D11Device::OpenSharedResource(
|
||||||
HANDLE hResource,
|
HANDLE hResource,
|
||||||
@ -1254,6 +1287,24 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D11Device::OpenSharedResource1(
|
||||||
|
HANDLE hResource,
|
||||||
|
REFIID ReturnedInterface,
|
||||||
|
void** ppResource) {
|
||||||
|
Logger::err("D3D11Device::OpenSharedResource1: Not implemented");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D11Device::OpenSharedResourceByName(
|
||||||
|
LPCWSTR lpName,
|
||||||
|
DWORD dwDesiredAccess,
|
||||||
|
REFIID returnedInterface,
|
||||||
|
void ** ppResource) {
|
||||||
|
Logger::err("D3D11Device::OpenSharedResourceByName: Not implemented");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11Device::CheckFormatSupport(
|
HRESULT STDMETHODCALLTYPE D3D11Device::CheckFormatSupport(
|
||||||
DXGI_FORMAT Format,
|
DXGI_FORMAT Format,
|
||||||
UINT* pFormatSupport) {
|
UINT* pFormatSupport) {
|
||||||
@ -1358,6 +1409,38 @@ namespace dxvk {
|
|||||||
info->ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x = TRUE;
|
info->ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x = TRUE;
|
||||||
} return S_OK;
|
} return S_OK;
|
||||||
|
|
||||||
|
case D3D11_FEATURE_D3D11_OPTIONS: {
|
||||||
|
if (FeatureSupportDataSize != sizeof(D3D11_FEATURE_DATA_D3D11_OPTIONS))
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
auto info = static_cast<D3D11_FEATURE_DATA_D3D11_OPTIONS*>(pFeatureSupportData);
|
||||||
|
|
||||||
|
/*TODO: implement and enable*/
|
||||||
|
/*https://msdn.microsoft.com/en-us/library/windows/desktop/hh404457(v=vs.85).aspx */
|
||||||
|
info->OutputMergerLogicOp = false;
|
||||||
|
info->UAVOnlyRenderingForcedSampleCount = false;
|
||||||
|
info->DiscardAPIsSeenByDriver = false;
|
||||||
|
info->FlagsForUpdateAndCopySeenByDriver = false;
|
||||||
|
info->ClearView = false;
|
||||||
|
info->CopyWithOverlap = false;
|
||||||
|
info->ConstantBufferPartialUpdate = false;
|
||||||
|
info->ConstantBufferOffsetting = false;
|
||||||
|
info->MapNoOverwriteOnDynamicConstantBuffer = false;
|
||||||
|
info->MapNoOverwriteOnDynamicBufferSRV = false;
|
||||||
|
info->MultisampleRTVWithForcedSampleCountOne = false;
|
||||||
|
info->SAD4ShaderInstructions = false;
|
||||||
|
info->ExtendedDoublesShaderInstructions = false;
|
||||||
|
info->ExtendedResourceSharing = false;
|
||||||
|
} return S_OK;
|
||||||
|
|
||||||
|
case D3D11_FEATURE_ARCHITECTURE_INFO: {
|
||||||
|
if (FeatureSupportDataSize != sizeof(D3D11_FEATURE_DATA_ARCHITECTURE_INFO))
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
auto info = static_cast<D3D11_FEATURE_DATA_ARCHITECTURE_INFO*>(pFeatureSupportData);
|
||||||
|
info->TileBasedDeferredRenderer = false;
|
||||||
|
} return S_OK;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Logger::err(str::format(
|
Logger::err(str::format(
|
||||||
"D3D11Device: CheckFeatureSupport: Unknown feature: ",
|
"D3D11Device: CheckFeatureSupport: Unknown feature: ",
|
||||||
@ -1408,6 +1491,11 @@ namespace dxvk {
|
|||||||
void STDMETHODCALLTYPE D3D11Device::GetImmediateContext(ID3D11DeviceContext** ppImmediateContext) {
|
void STDMETHODCALLTYPE D3D11Device::GetImmediateContext(ID3D11DeviceContext** ppImmediateContext) {
|
||||||
*ppImmediateContext = ref(m_context);
|
*ppImmediateContext = ref(m_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void STDMETHODCALLTYPE D3D11Device::GetImmediateContext1(ID3D11DeviceContext1 ** ppImmediateContext) {
|
||||||
|
*ppImmediateContext = ref(m_context);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11Device::SetExceptionMode(UINT RaiseFlags) {
|
HRESULT STDMETHODCALLTYPE D3D11Device::SetExceptionMode(UINT RaiseFlags) {
|
||||||
|
@ -28,7 +28,7 @@ namespace dxvk {
|
|||||||
class D3D11Texture2D;
|
class D3D11Texture2D;
|
||||||
class D3D11Texture3D;
|
class D3D11Texture3D;
|
||||||
|
|
||||||
class D3D11Device : public ComObject<ID3D11Device> {
|
class D3D11Device : public ComObject<ID3D11Device1> {
|
||||||
/// Maximum number of resource init commands per command buffer
|
/// Maximum number of resource init commands per command buffer
|
||||||
constexpr static uint64_t InitCommandThreshold = 50;
|
constexpr static uint64_t InitCommandThreshold = 50;
|
||||||
public:
|
public:
|
||||||
@ -144,6 +144,10 @@ namespace dxvk {
|
|||||||
const D3D11_BLEND_DESC* pBlendStateDesc,
|
const D3D11_BLEND_DESC* pBlendStateDesc,
|
||||||
ID3D11BlendState** ppBlendState) final;
|
ID3D11BlendState** ppBlendState) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE CreateBlendState1(
|
||||||
|
const D3D11_BLEND_DESC1* pBlendStateDesc,
|
||||||
|
ID3D11BlendState1** ppBlendState) final;
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CreateDepthStencilState(
|
HRESULT STDMETHODCALLTYPE CreateDepthStencilState(
|
||||||
const D3D11_DEPTH_STENCIL_DESC* pDepthStencilDesc,
|
const D3D11_DEPTH_STENCIL_DESC* pDepthStencilDesc,
|
||||||
ID3D11DepthStencilState** ppDepthStencilState) final;
|
ID3D11DepthStencilState** ppDepthStencilState) final;
|
||||||
@ -152,6 +156,10 @@ namespace dxvk {
|
|||||||
const D3D11_RASTERIZER_DESC* pRasterizerDesc,
|
const D3D11_RASTERIZER_DESC* pRasterizerDesc,
|
||||||
ID3D11RasterizerState** ppRasterizerState) final;
|
ID3D11RasterizerState** ppRasterizerState) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE CreateRasterizerState1(
|
||||||
|
const D3D11_RASTERIZER_DESC1* pRasterizerDesc,
|
||||||
|
ID3D11RasterizerState1** ppRasterizerState) final;
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CreateSamplerState(
|
HRESULT STDMETHODCALLTYPE CreateSamplerState(
|
||||||
const D3D11_SAMPLER_DESC* pSamplerDesc,
|
const D3D11_SAMPLER_DESC* pSamplerDesc,
|
||||||
ID3D11SamplerState** ppSamplerState) final;
|
ID3D11SamplerState** ppSamplerState) final;
|
||||||
@ -171,11 +179,35 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE CreateDeferredContext(
|
HRESULT STDMETHODCALLTYPE CreateDeferredContext(
|
||||||
UINT ContextFlags,
|
UINT ContextFlags,
|
||||||
ID3D11DeviceContext** ppDeferredContext) final;
|
ID3D11DeviceContext** ppDeferredContext) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE CreateDeferredContext1(
|
||||||
|
UINT ContextFlags,
|
||||||
|
ID3D11DeviceContext1** ppDeferredContext) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE CreateDeviceContextState(
|
||||||
|
UINT Flags,
|
||||||
|
const D3D_FEATURE_LEVEL* pFeatureLevels,
|
||||||
|
UINT FeatureLevels,
|
||||||
|
UINT SDKVersion,
|
||||||
|
REFIID EmulatedInterface,
|
||||||
|
D3D_FEATURE_LEVEL* pChosenFeatureLevel,
|
||||||
|
ID3DDeviceContextState** ppContextState) final;
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE OpenSharedResource(
|
HRESULT STDMETHODCALLTYPE OpenSharedResource(
|
||||||
HANDLE hResource,
|
HANDLE hResource,
|
||||||
REFIID ReturnedInterface,
|
REFIID ReturnedInterface,
|
||||||
void** ppResource) final;
|
void** ppResource) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE OpenSharedResource1(
|
||||||
|
HANDLE hResource,
|
||||||
|
REFIID returnedInterface,
|
||||||
|
void** ppResource) final;
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE OpenSharedResourceByName(
|
||||||
|
LPCWSTR lpName,
|
||||||
|
DWORD dwDesiredAccess,
|
||||||
|
REFIID returnedInterface,
|
||||||
|
void** ppResource) final;
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CheckFormatSupport(
|
HRESULT STDMETHODCALLTYPE CheckFormatSupport(
|
||||||
DXGI_FORMAT Format,
|
DXGI_FORMAT Format,
|
||||||
@ -227,6 +259,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
void STDMETHODCALLTYPE GetImmediateContext(
|
void STDMETHODCALLTYPE GetImmediateContext(
|
||||||
ID3D11DeviceContext** ppImmediateContext) final;
|
ID3D11DeviceContext** ppImmediateContext) final;
|
||||||
|
|
||||||
|
void STDMETHODCALLTYPE GetImmediateContext1(
|
||||||
|
ID3D11DeviceContext1** ppImmediateContext) final;
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE SetExceptionMode(UINT RaiseFlags) final;
|
HRESULT STDMETHODCALLTYPE SetExceptionMode(UINT RaiseFlags) final;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user