1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 19:24:12 +01:00

[d3d11] Partially implement SOSetTargets/SOGetTargets

This does not implement any stream output functionality yet,
but it allows games to set and query stream output buffers.
This commit is contained in:
Philip Rebohle 2018-03-07 15:32:19 +01:00
parent 360bf3ee4c
commit 95e2c641e0
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 15 additions and 5 deletions

View File

@ -2035,16 +2035,20 @@ namespace dxvk {
UINT NumBuffers,
ID3D11Buffer* const* ppSOTargets,
const UINT* pOffsets) {
if (NumBuffers > 0)
Logger::err("D3D11DeviceContext::SOSetTargets: Not implemented");
// TODO implement properly, including pOffsets
for (uint32_t i = 0; i < D3D11_SO_STREAM_COUNT; i++) {
m_state.so.targets[i] = (ppSOTargets != nullptr && i < NumBuffers)
? static_cast<D3D11Buffer*>(ppSOTargets[i])
: nullptr;
}
}
void STDMETHODCALLTYPE D3D11DeviceContext::SOGetTargets(
UINT NumBuffers,
ID3D11Buffer** ppSOTargets) {
if (NumBuffers > 0)
Logger::err("D3D11DeviceContext::SOGetTargets: Not implemented");
for (uint32_t i = 0; i < NumBuffers; i++)
ppSOTargets[i] = m_state.so.targets[i].ref();
}

View File

@ -28,7 +28,7 @@ namespace dxvk {
using D3D11UnorderedAccessBindings = std::array<
Com<D3D11UnorderedAccessView>, D3D11_1_UAV_SLOT_COUNT>;
struct D3D11ContextStateVS {
Com<D3D11VertexShader> shader;
@ -127,6 +127,11 @@ namespace dxvk {
};
struct D3D11ContextStateSO {
std::array<Com<D3D11Buffer>, D3D11_SO_STREAM_COUNT> targets;
};
/**
* \brief Context state
*/
@ -141,6 +146,7 @@ namespace dxvk {
D3D11ContextStateIA ia;
D3D11ContextStateOM om;
D3D11ContextStateRS rs;
D3D11ContextStateSO so;
};
}