[d3d11] Move *SetShader methods to D3D11CommonContext

This commit is contained in:
Philip Rebohle 2022-08-03 19:13:41 +02:00
parent e0ee06a279
commit 26ac57f688
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 270 additions and 258 deletions

View File

@ -1284,25 +1284,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::VSSetShader(
ID3D11VertexShader* pVertexShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11VertexShader*>(pVertexShader);
if (NumClassInstances != 0)
Logger::err("D3D11: Class instances not supported");
if (m_state.vs.shader != shader) {
m_state.vs.shader = shader;
BindShader<DxbcProgramType::VertexShader>(GetCommonShader(shader));
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::VSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1359,20 +1340,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::VSGetShader(
ID3D11VertexShader** ppVertexShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppVertexShader != nullptr)
*ppVertexShader = m_state.vs.shader.ref();
if (pNumClassInstances != nullptr)
*pNumClassInstances = 0;
}
void STDMETHODCALLTYPE D3D11DeviceContext::VSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1426,25 +1393,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::HSSetShader(
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11HullShader*>(pHullShader);
if (NumClassInstances != 0)
Logger::err("D3D11: Class instances not supported");
if (m_state.hs.shader != shader) {
m_state.hs.shader = shader;
BindShader<DxbcProgramType::HullShader>(GetCommonShader(shader));
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::HSSetShaderResources(
UINT StartSlot,
UINT NumViews,
@ -1501,20 +1449,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::HSGetShader(
ID3D11HullShader** ppHullShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppHullShader != nullptr)
*ppHullShader = m_state.hs.shader.ref();
if (pNumClassInstances != nullptr)
*pNumClassInstances = 0;
}
void STDMETHODCALLTYPE D3D11DeviceContext::HSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1568,25 +1502,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::DSSetShader(
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11DomainShader*>(pDomainShader);
if (NumClassInstances != 0)
Logger::err("D3D11: Class instances not supported");
if (m_state.ds.shader != shader) {
m_state.ds.shader = shader;
BindShader<DxbcProgramType::DomainShader>(GetCommonShader(shader));
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::DSSetShaderResources(
UINT StartSlot,
UINT NumViews,
@ -1643,20 +1558,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::DSGetShader(
ID3D11DomainShader** ppDomainShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppDomainShader != nullptr)
*ppDomainShader = m_state.ds.shader.ref();
if (pNumClassInstances != nullptr)
*pNumClassInstances = 0;
}
void STDMETHODCALLTYPE D3D11DeviceContext::DSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1710,25 +1611,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::GSSetShader(
ID3D11GeometryShader* pShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11GeometryShader*>(pShader);
if (NumClassInstances != 0)
Logger::err("D3D11: Class instances not supported");
if (m_state.gs.shader != shader) {
m_state.gs.shader = shader;
BindShader<DxbcProgramType::GeometryShader>(GetCommonShader(shader));
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::GSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1785,20 +1667,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::GSGetShader(
ID3D11GeometryShader** ppGeometryShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppGeometryShader != nullptr)
*ppGeometryShader = m_state.gs.shader.ref();
if (pNumClassInstances != nullptr)
*pNumClassInstances = 0;
}
void STDMETHODCALLTYPE D3D11DeviceContext::GSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1852,25 +1720,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::PSSetShader(
ID3D11PixelShader* pPixelShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11PixelShader*>(pPixelShader);
if (NumClassInstances != 0)
Logger::err("D3D11: Class instances not supported");
if (m_state.ps.shader != shader) {
m_state.ps.shader = shader;
BindShader<DxbcProgramType::PixelShader>(GetCommonShader(shader));
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::PSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1927,20 +1776,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::PSGetShader(
ID3D11PixelShader** ppPixelShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppPixelShader != nullptr)
*ppPixelShader = m_state.ps.shader.ref();
if (pNumClassInstances != nullptr)
*pNumClassInstances = 0;
}
void STDMETHODCALLTYPE D3D11DeviceContext::PSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -1994,25 +1829,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::CSSetShader(
ID3D11ComputeShader* pComputeShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11ComputeShader*>(pComputeShader);
if (NumClassInstances != 0)
Logger::err("D3D11: Class instances not supported");
if (m_state.cs.shader != shader) {
m_state.cs.shader = shader;
BindShader<DxbcProgramType::ComputeShader>(GetCommonShader(shader));
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::CSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -2125,20 +1941,6 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::CSGetShader(
ID3D11ComputeShader** ppComputeShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppComputeShader != nullptr)
*ppComputeShader = m_state.cs.shader.ref();
if (pNumClassInstances != nullptr)
*pNumClassInstances = 0;
}
void STDMETHODCALLTYPE D3D11DeviceContext::CSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,

View File

@ -208,11 +208,6 @@ namespace dxvk {
ID3D11Buffer* pBufferForArgs,
UINT AlignedByteOffsetForArgs);
void STDMETHODCALLTYPE VSSetShader(
ID3D11VertexShader* pVertexShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE VSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -235,11 +230,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
void STDMETHODCALLTYPE VSGetShader(
ID3D11VertexShader** ppVertexShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE VSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -262,11 +252,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
void STDMETHODCALLTYPE HSSetShader(
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE HSSetShaderResources(
UINT StartSlot,
UINT NumViews,
@ -289,11 +274,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
void STDMETHODCALLTYPE HSGetShader(
ID3D11HullShader** ppHullShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE HSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -316,11 +296,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
void STDMETHODCALLTYPE DSSetShader(
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE DSSetShaderResources(
UINT StartSlot,
UINT NumViews,
@ -343,11 +318,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
void STDMETHODCALLTYPE DSGetShader(
ID3D11DomainShader** ppDomainShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE DSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -370,11 +340,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
void STDMETHODCALLTYPE GSSetShader(
ID3D11GeometryShader* pShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE GSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -397,11 +362,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
void STDMETHODCALLTYPE GSGetShader(
ID3D11GeometryShader** ppGeometryShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE GSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -424,11 +384,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
void STDMETHODCALLTYPE PSSetShader(
ID3D11PixelShader* pPixelShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE PSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -451,11 +406,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
void STDMETHODCALLTYPE PSGetShader(
ID3D11PixelShader** ppPixelShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE PSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -478,11 +428,6 @@ namespace dxvk {
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
void STDMETHODCALLTYPE CSSetShader(
ID3D11ComputeShader* pComputeShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE CSSetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,
@ -511,11 +456,6 @@ namespace dxvk {
ID3D11UnorderedAccessView* const* ppUnorderedAccessViews,
const UINT* pUAVInitialCounts);
void STDMETHODCALLTYPE CSGetShader(
ID3D11ComputeShader** ppComputeShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE CSGetConstantBuffers(
UINT StartSlot,
UINT NumBuffers,

View File

@ -245,6 +245,216 @@ namespace dxvk {
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::VSSetShader(
ID3D11VertexShader* pVertexShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11VertexShader*>(pVertexShader);
if (NumClassInstances)
Logger::err("D3D11: Class instances not supported");
if (m_state.vs.shader != shader) {
m_state.vs.shader = shader;
BindShader<DxbcProgramType::VertexShader>(GetCommonShader(shader));
}
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::VSGetShader(
ID3D11VertexShader** ppVertexShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppVertexShader)
*ppVertexShader = m_state.vs.shader.ref();
if (pNumClassInstances)
*pNumClassInstances = 0;
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::HSSetShader(
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11HullShader*>(pHullShader);
if (NumClassInstances)
Logger::err("D3D11: Class instances not supported");
if (m_state.hs.shader != shader) {
m_state.hs.shader = shader;
BindShader<DxbcProgramType::HullShader>(GetCommonShader(shader));
}
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::HSGetShader(
ID3D11HullShader** ppHullShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppHullShader)
*ppHullShader = m_state.hs.shader.ref();
if (pNumClassInstances)
*pNumClassInstances = 0;
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::DSSetShader(
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11DomainShader*>(pDomainShader);
if (NumClassInstances)
Logger::err("D3D11: Class instances not supported");
if (m_state.ds.shader != shader) {
m_state.ds.shader = shader;
BindShader<DxbcProgramType::DomainShader>(GetCommonShader(shader));
}
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::DSGetShader(
ID3D11DomainShader** ppDomainShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppDomainShader)
*ppDomainShader = m_state.ds.shader.ref();
if (pNumClassInstances)
*pNumClassInstances = 0;
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::GSSetShader(
ID3D11GeometryShader* pShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11GeometryShader*>(pShader);
if (NumClassInstances)
Logger::err("D3D11: Class instances not supported");
if (m_state.gs.shader != shader) {
m_state.gs.shader = shader;
BindShader<DxbcProgramType::GeometryShader>(GetCommonShader(shader));
}
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::GSGetShader(
ID3D11GeometryShader** ppGeometryShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppGeometryShader)
*ppGeometryShader = m_state.gs.shader.ref();
if (pNumClassInstances)
*pNumClassInstances = 0;
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::PSSetShader(
ID3D11PixelShader* pPixelShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11PixelShader*>(pPixelShader);
if (NumClassInstances)
Logger::err("D3D11: Class instances not supported");
if (m_state.ps.shader != shader) {
m_state.ps.shader = shader;
BindShader<DxbcProgramType::PixelShader>(GetCommonShader(shader));
}
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::PSGetShader(
ID3D11PixelShader** ppPixelShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppPixelShader)
*ppPixelShader = m_state.ps.shader.ref();
if (pNumClassInstances)
*pNumClassInstances = 0;
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::CSSetShader(
ID3D11ComputeShader* pComputeShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
D3D10DeviceLock lock = LockContext();
auto shader = static_cast<D3D11ComputeShader*>(pComputeShader);
if (NumClassInstances)
Logger::err("D3D11: Class instances not supported");
if (m_state.cs.shader != shader) {
m_state.cs.shader = shader;
BindShader<DxbcProgramType::ComputeShader>(GetCommonShader(shader));
}
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::CSGetShader(
ID3D11ComputeShader** ppComputeShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances) {
D3D10DeviceLock lock = LockContext();
if (ppComputeShader)
*ppComputeShader = m_state.cs.shader.ref();
if (pNumClassInstances)
*pNumClassInstances = 0;
}
template<typename ContextType>
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::OMSetRenderTargets(
UINT NumViews,

View File

@ -121,6 +121,66 @@ namespace dxvk {
DXGI_FORMAT* pFormat,
UINT* pOffset);
void STDMETHODCALLTYPE VSSetShader(
ID3D11VertexShader* pVertexShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE VSGetShader(
ID3D11VertexShader** ppVertexShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE HSSetShader(
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE HSGetShader(
ID3D11HullShader** ppHullShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE DSSetShader(
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE DSGetShader(
ID3D11DomainShader** ppDomainShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE GSSetShader(
ID3D11GeometryShader* pShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE GSGetShader(
ID3D11GeometryShader** ppGeometryShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE PSSetShader(
ID3D11PixelShader* pPixelShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE PSGetShader(
ID3D11PixelShader** ppPixelShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE CSSetShader(
ID3D11ComputeShader* pComputeShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
void STDMETHODCALLTYPE CSGetShader(
ID3D11ComputeShader** ppComputeShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
void STDMETHODCALLTYPE OMSetRenderTargets(
UINT NumViews,
ID3D11RenderTargetView* const* ppRenderTargetViews,