mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[d3d11] Implement D3D11DeviceContext::SwapDeviceContextState
This commit is contained in:
parent
82c6a5eb1a
commit
f733d082f4
@ -127,13 +127,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeviceContext::SwapDeviceContextState(
|
||||
ID3DDeviceContextState* pState,
|
||||
ID3DDeviceContextState** ppPreviousState) {
|
||||
Logger::err("D3D11DeviceContext::SwapDeviceContextState: Not implemented");
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeviceContext::GetDevice(ID3D11Device **ppDevice) {
|
||||
*ppDevice = ref(m_parent);
|
||||
}
|
||||
|
@ -39,10 +39,6 @@ namespace dxvk {
|
||||
const D3D11_RECT* pRects,
|
||||
UINT NumRects);
|
||||
|
||||
void STDMETHODCALLTYPE SwapDeviceContextState(
|
||||
ID3DDeviceContextState* pState,
|
||||
ID3DDeviceContextState** ppPreviousState);
|
||||
|
||||
void STDMETHODCALLTYPE GetDevice(ID3D11Device **ppDevice);
|
||||
|
||||
void STDMETHODCALLTYPE ClearState();
|
||||
|
@ -159,6 +159,13 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeferredContext::SwapDeviceContextState(
|
||||
ID3DDeviceContextState* pState,
|
||||
ID3DDeviceContextState** ppPreviousState) {
|
||||
Logger::err("D3D11: SwapDeviceContextState called on a deferred context");
|
||||
}
|
||||
|
||||
|
||||
HRESULT D3D11DeferredContext::MapBuffer(
|
||||
ID3D11Resource* pResource,
|
||||
D3D11_MAP MapType,
|
||||
|
@ -61,6 +61,10 @@ namespace dxvk {
|
||||
ID3D11Resource* pResource,
|
||||
UINT Subresource);
|
||||
|
||||
void STDMETHODCALLTYPE SwapDeviceContextState(
|
||||
ID3DDeviceContextState* pState,
|
||||
ID3DDeviceContextState** ppPreviousState);
|
||||
|
||||
private:
|
||||
|
||||
const UINT m_contextFlags;
|
||||
|
@ -535,6 +535,32 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11ImmediateContext::SwapDeviceContextState(
|
||||
ID3DDeviceContextState* pState,
|
||||
ID3DDeviceContextState** ppPreviousState) {
|
||||
InitReturnPtr(ppPreviousState);
|
||||
|
||||
if (!pState)
|
||||
return;
|
||||
|
||||
Com<D3D11DeviceContextState> oldState = std::move(m_stateObject);
|
||||
Com<D3D11DeviceContextState> newState = static_cast<D3D11DeviceContextState*>(pState);
|
||||
|
||||
if (oldState == nullptr)
|
||||
oldState = new D3D11DeviceContextState(m_parent);
|
||||
|
||||
if (ppPreviousState)
|
||||
*ppPreviousState = oldState.ref();
|
||||
|
||||
m_stateObject = newState;
|
||||
|
||||
oldState->SetState(m_state);
|
||||
newState->GetState(m_state);
|
||||
|
||||
RestoreState();
|
||||
}
|
||||
|
||||
|
||||
void D3D11ImmediateContext::SynchronizeCsThread() {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <chrono>
|
||||
|
||||
#include "d3d11_context.h"
|
||||
#include "d3d11_state_object.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
@ -121,6 +122,10 @@ namespace dxvk {
|
||||
ID3D11UnorderedAccessView* const* ppUnorderedAccessViews,
|
||||
const UINT* pUAVInitialCounts);
|
||||
|
||||
void STDMETHODCALLTYPE SwapDeviceContextState(
|
||||
ID3DDeviceContextState* pState,
|
||||
ID3DDeviceContextState** ppPreviousState);
|
||||
|
||||
void SynchronizeCsThread();
|
||||
|
||||
private:
|
||||
@ -131,6 +136,8 @@ namespace dxvk {
|
||||
std::chrono::high_resolution_clock::time_point m_lastFlush
|
||||
= std::chrono::high_resolution_clock::now();
|
||||
|
||||
Com<D3D11DeviceContextState> m_stateObject;
|
||||
|
||||
HRESULT MapBuffer(
|
||||
D3D11Buffer* pResource,
|
||||
D3D11_MAP MapType,
|
||||
|
Loading…
x
Reference in New Issue
Block a user