From 589bc50842e0af423f9da3cde2d577d3b225d0f8 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 12 Aug 2018 00:58:34 +0200 Subject: [PATCH] [d3d10] Implement (VS|GS|PS)(Set|Get)Shader --- src/d3d10/d3d10_device.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/d3d10/d3d10_device.cpp b/src/d3d10/d3d10_device.cpp index 7e618311b..74be54ee1 100644 --- a/src/d3d10/d3d10_device.cpp +++ b/src/d3d10/d3d10_device.cpp @@ -995,7 +995,10 @@ namespace dxvk { void STDMETHODCALLTYPE D3D10Device::VSSetShader( ID3D10VertexShader* pVertexShader) { - Logger::err("D3D10Device::VSSetShader: Not implemented"); + D3D10VertexShader* d3d10Shader = static_cast(pVertexShader); + D3D11VertexShader* d3d11Shader = d3d10Shader ? d3d10Shader->GetD3D11Iface() : nullptr; + + m_context->VSSetShader(d3d11Shader, nullptr, 0); } @@ -1049,7 +1052,10 @@ namespace dxvk { void STDMETHODCALLTYPE D3D10Device::VSGetShader( ID3D10VertexShader** ppVertexShader) { - Logger::err("D3D10Device::VSGetShader: Not implemented"); + ID3D11VertexShader* d3d11Shader = nullptr; + m_context->VSGetShader(&d3d11Shader, nullptr, nullptr); + + *ppVertexShader = static_cast(d3d11Shader)->GetD3D10Iface(); } @@ -1100,7 +1106,10 @@ namespace dxvk { void STDMETHODCALLTYPE D3D10Device::GSSetShader( ID3D10GeometryShader* pShader) { - Logger::err("D3D10Device::GSSetShader: Not implemented"); + D3D10GeometryShader* d3d10Shader = static_cast(pShader); + D3D11GeometryShader* d3d11Shader = d3d10Shader ? d3d10Shader->GetD3D11Iface() : nullptr; + + m_context->GSSetShader(d3d11Shader, nullptr, 0); } @@ -1154,7 +1163,10 @@ namespace dxvk { void STDMETHODCALLTYPE D3D10Device::GSGetShader( ID3D10GeometryShader** ppGeometryShader) { - Logger::err("D3D10Device::GSGetShader: Not implemented"); + ID3D11GeometryShader* d3d11Shader = nullptr; + m_context->GSGetShader(&d3d11Shader, nullptr, nullptr); + + *ppGeometryShader = static_cast(d3d11Shader)->GetD3D10Iface(); } @@ -1205,7 +1217,10 @@ namespace dxvk { void STDMETHODCALLTYPE D3D10Device::PSSetShader( ID3D10PixelShader* pPixelShader) { - Logger::err("D3D10Device::PSSetShader: Not implemented"); + D3D10PixelShader* d3d10Shader = static_cast(pPixelShader); + D3D11PixelShader* d3d11Shader = d3d10Shader ? d3d10Shader->GetD3D11Iface() : nullptr; + + m_context->PSSetShader(d3d11Shader, nullptr, 0); } @@ -1259,7 +1274,10 @@ namespace dxvk { void STDMETHODCALLTYPE D3D10Device::PSGetShader( ID3D10PixelShader** ppPixelShader) { - Logger::err("D3D10Device::PSGetShader: Not implemented"); + ID3D11PixelShader* d3d11Shader = nullptr; + m_context->PSGetShader(&d3d11Shader, nullptr, nullptr); + + *ppPixelShader = static_cast(d3d11Shader)->GetD3D10Iface(); }