mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-08 10:46:09 +01:00
99813a7778
Closes #323.
87 lines
2.6 KiB
C++
87 lines
2.6 KiB
C++
#pragma once
|
|
|
|
#include "d3d11_context.h"
|
|
|
|
namespace dxvk {
|
|
|
|
class D3D11Buffer;
|
|
class D3D11CommonTexture;
|
|
|
|
class D3D11ImmediateContext : public D3D11DeviceContext {
|
|
constexpr static UINT MaxPendingDraws = 500;
|
|
public:
|
|
|
|
D3D11ImmediateContext(
|
|
D3D11Device* pParent,
|
|
const Rc<DxvkDevice>& Device);
|
|
~D3D11ImmediateContext();
|
|
|
|
ULONG STDMETHODCALLTYPE AddRef() final;
|
|
|
|
ULONG STDMETHODCALLTYPE Release() final;
|
|
|
|
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType() final;
|
|
|
|
UINT STDMETHODCALLTYPE GetContextFlags() final;
|
|
|
|
void STDMETHODCALLTYPE Flush() final;
|
|
|
|
void STDMETHODCALLTYPE ExecuteCommandList(
|
|
ID3D11CommandList* pCommandList,
|
|
BOOL RestoreContextState) final;
|
|
|
|
HRESULT STDMETHODCALLTYPE FinishCommandList(
|
|
BOOL RestoreDeferredContextState,
|
|
ID3D11CommandList **ppCommandList) final;
|
|
|
|
HRESULT STDMETHODCALLTYPE Map(
|
|
ID3D11Resource* pResource,
|
|
UINT Subresource,
|
|
D3D11_MAP MapType,
|
|
UINT MapFlags,
|
|
D3D11_MAPPED_SUBRESOURCE* pMappedResource) final;
|
|
|
|
void STDMETHODCALLTYPE Unmap(
|
|
ID3D11Resource* pResource,
|
|
UINT Subresource) final;
|
|
|
|
void STDMETHODCALLTYPE OMSetRenderTargets(
|
|
UINT NumViews,
|
|
ID3D11RenderTargetView* const* ppRenderTargetViews,
|
|
ID3D11DepthStencilView* pDepthStencilView) final;
|
|
|
|
void SynchronizeCsThread();
|
|
|
|
private:
|
|
|
|
DxvkCsThread m_csThread;
|
|
bool m_csIsBusy = false;
|
|
|
|
HRESULT MapBuffer(
|
|
D3D11Buffer* pResource,
|
|
D3D11_MAP MapType,
|
|
UINT MapFlags,
|
|
D3D11_MAPPED_SUBRESOURCE* pMappedResource);
|
|
|
|
HRESULT MapImage(
|
|
D3D11CommonTexture* pResource,
|
|
UINT Subresource,
|
|
D3D11_MAP MapType,
|
|
UINT MapFlags,
|
|
D3D11_MAPPED_SUBRESOURCE* pMappedResource);
|
|
|
|
void UnmapImage(
|
|
D3D11CommonTexture* pResource,
|
|
UINT Subresource);
|
|
|
|
void SynchronizeDevice();
|
|
|
|
bool WaitForResource(
|
|
const Rc<DxvkResource>& Resource,
|
|
UINT MapFlags);
|
|
|
|
void EmitCsChunk(Rc<DxvkCsChunk>&& chunk) final;
|
|
|
|
};
|
|
|
|
} |