1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-14 09:23:53 +01:00
dxvk/src/d3d11/d3d11_context.h

969 lines
40 KiB
C
Raw Normal View History

2017-10-11 09:51:48 +02:00
#pragma once
#include "../dxvk/dxvk_adapter.h"
#include "../dxvk/dxvk_cs.h"
#include "../dxvk/dxvk_device.h"
#include "../d3d10/d3d10_multithread.h"
#include "d3d11_annotation.h"
#include "d3d11_cmd.h"
#include "d3d11_context_ext.h"
#include "d3d11_context_state.h"
2017-10-11 09:51:48 +02:00
#include "d3d11_device_child.h"
#include "d3d11_texture.h"
2017-10-11 09:51:48 +02:00
namespace dxvk {
class D3D11Device;
2019-09-16 13:17:00 +02:00
class D3D11DeviceContext : public D3D11DeviceChild<ID3D11DeviceContext4> {
friend class D3D11DeviceContextExt;
2017-10-11 09:51:48 +02:00
public:
D3D11DeviceContext(
D3D11Device* pParent,
const Rc<DxvkDevice>& Device,
DxvkCsChunkFlags CsFlags);
2017-10-11 09:51:48 +02:00
~D3D11DeviceContext();
2017-12-12 12:50:52 +01:00
HRESULT STDMETHODCALLTYPE QueryInterface(
2017-10-11 09:51:48 +02:00
REFIID riid,
void** ppvObject);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE DiscardResource(ID3D11Resource *pResource);
void STDMETHODCALLTYPE DiscardView(ID3D11View* pResourceView);
void STDMETHODCALLTYPE DiscardView1(
ID3D11View* pResourceView,
const D3D11_RECT* pRects,
UINT NumRects);
void STDMETHODCALLTYPE GetDevice(ID3D11Device **ppDevice);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE ClearState();
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE Begin(ID3D11Asynchronous *pAsync);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE End(ID3D11Asynchronous *pAsync);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE SetPredication(
2017-10-11 09:51:48 +02:00
ID3D11Predicate* pPredicate,
BOOL PredicateValue);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GetPredication(
2017-10-11 09:51:48 +02:00
ID3D11Predicate** ppPredicate,
BOOL* pPredicateValue);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CopySubresourceRegion(
2017-10-11 09:51:48 +02:00
ID3D11Resource* pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE CopySubresourceRegion1(
ID3D11Resource* pDstResource,
UINT DstSubresource,
UINT DstX,
UINT DstY,
UINT DstZ,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
const D3D11_BOX* pSrcBox,
UINT CopyFlags);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CopyResource(
2017-10-11 09:51:48 +02:00
ID3D11Resource* pDstResource,
ID3D11Resource* pSrcResource);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CopyStructureCount(
2017-10-11 09:51:48 +02:00
ID3D11Buffer* pDstBuffer,
UINT DstAlignedByteOffset,
ID3D11UnorderedAccessView* pSrcView);
void STDMETHODCALLTYPE CopyTiles(
ID3D11Resource* pTiledResource,
const D3D11_TILED_RESOURCE_COORDINATE* pTileRegionStartCoordinate,
const D3D11_TILE_REGION_SIZE* pTileRegionSize,
ID3D11Buffer* pBuffer,
UINT64 BufferStartOffsetInBytes,
UINT Flags);
HRESULT STDMETHODCALLTYPE CopyTileMappings(
ID3D11Resource* pDestTiledResource,
const D3D11_TILED_RESOURCE_COORDINATE* pDestRegionStartCoordinate,
ID3D11Resource* pSourceTiledResource,
const D3D11_TILED_RESOURCE_COORDINATE* pSourceRegionStartCoordinate,
const D3D11_TILE_REGION_SIZE* pTileRegionSize,
UINT Flags);
HRESULT STDMETHODCALLTYPE ResizeTilePool(
ID3D11Buffer* pTilePool,
UINT64 NewSizeInBytes);
void STDMETHODCALLTYPE TiledResourceBarrier(
ID3D11DeviceChild* pTiledResourceOrViewAccessBeforeBarrier,
ID3D11DeviceChild* pTiledResourceOrViewAccessAfterBarrier);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE ClearRenderTargetView(
2017-10-11 09:51:48 +02:00
ID3D11RenderTargetView* pRenderTargetView,
const FLOAT ColorRGBA[4]);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE ClearUnorderedAccessViewUint(
2017-10-11 09:51:48 +02:00
ID3D11UnorderedAccessView* pUnorderedAccessView,
const UINT Values[4]);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat(
2017-10-11 09:51:48 +02:00
ID3D11UnorderedAccessView* pUnorderedAccessView,
const FLOAT Values[4]);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE ClearDepthStencilView(
2017-10-11 09:51:48 +02:00
ID3D11DepthStencilView* pDepthStencilView,
UINT ClearFlags,
FLOAT Depth,
UINT8 Stencil);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE ClearView(
ID3D11View *pView,
const FLOAT Color[4],
const D3D11_RECT *pRect,
UINT NumRects);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GenerateMips(
ID3D11ShaderResourceView* pShaderResourceView);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE UpdateSubresource(
2017-10-11 09:51:48 +02:00
ID3D11Resource* pDstResource,
UINT DstSubresource,
const D3D11_BOX* pDstBox,
const void* pSrcData,
UINT SrcRowPitch,
UINT SrcDepthPitch);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE UpdateSubresource1(
ID3D11Resource* pDstResource,
UINT DstSubresource,
const D3D11_BOX* pDstBox,
const void* pSrcData,
UINT SrcRowPitch,
UINT SrcDepthPitch,
UINT CopyFlags);
HRESULT STDMETHODCALLTYPE UpdateTileMappings(
ID3D11Resource* pTiledResource,
UINT NumTiledResourceRegions,
const D3D11_TILED_RESOURCE_COORDINATE* pTiledResourceRegionStartCoordinates,
const D3D11_TILE_REGION_SIZE* pTiledResourceRegionSizes,
ID3D11Buffer* pTilePool,
UINT NumRanges,
const UINT* pRangeFlags,
const UINT* pTilePoolStartOffsets,
const UINT* pRangeTileCounts,
UINT Flags);
void STDMETHODCALLTYPE UpdateTiles(
ID3D11Resource* pDestTiledResource,
const D3D11_TILED_RESOURCE_COORDINATE* pDestTileRegionStartCoordinate,
const D3D11_TILE_REGION_SIZE* pDestTileRegionSize,
const void* pSourceTileData,
UINT Flags);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE SetResourceMinLOD(
2017-10-11 09:51:48 +02:00
ID3D11Resource* pResource,
FLOAT MinLOD);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
FLOAT STDMETHODCALLTYPE GetResourceMinLOD(
ID3D11Resource* pResource);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE ResolveSubresource(
2017-10-11 09:51:48 +02:00
ID3D11Resource* pDstResource,
UINT DstSubresource,
ID3D11Resource* pSrcResource,
UINT SrcSubresource,
DXGI_FORMAT Format);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE DrawAuto();
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE Draw(
2017-10-11 09:51:48 +02:00
UINT VertexCount,
UINT StartVertexLocation);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DrawIndexed(
2017-10-11 09:51:48 +02:00
UINT IndexCount,
UINT StartIndexLocation,
INT BaseVertexLocation);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DrawInstanced(
2017-10-11 09:51:48 +02:00
UINT VertexCountPerInstance,
UINT InstanceCount,
UINT StartVertexLocation,
UINT StartInstanceLocation);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DrawIndexedInstanced(
2017-10-11 09:51:48 +02:00
UINT IndexCountPerInstance,
UINT InstanceCount,
UINT StartIndexLocation,
INT BaseVertexLocation,
UINT StartInstanceLocation);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DrawIndexedInstancedIndirect(
2017-10-11 09:51:48 +02:00
ID3D11Buffer* pBufferForArgs,
UINT AlignedByteOffsetForArgs);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DrawInstancedIndirect(
2017-10-11 09:51:48 +02:00
ID3D11Buffer* pBufferForArgs,
UINT AlignedByteOffsetForArgs);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE Dispatch(
2017-10-11 09:51:48 +02:00
UINT ThreadGroupCountX,
UINT ThreadGroupCountY,
UINT ThreadGroupCountZ);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DispatchIndirect(
2017-10-11 09:51:48 +02:00
ID3D11Buffer* pBufferForArgs,
UINT AlignedByteOffsetForArgs);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IASetInputLayout(
ID3D11InputLayout* pInputLayout);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IASetPrimitiveTopology(
D3D11_PRIMITIVE_TOPOLOGY Topology);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IASetVertexBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppVertexBuffers,
const UINT* pStrides,
const UINT* pOffsets);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IASetIndexBuffer(
2017-10-11 09:51:48 +02:00
ID3D11Buffer* pIndexBuffer,
DXGI_FORMAT Format,
UINT Offset);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IAGetInputLayout(
ID3D11InputLayout** ppInputLayout);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IAGetPrimitiveTopology(
D3D11_PRIMITIVE_TOPOLOGY* pTopology);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IAGetVertexBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppVertexBuffers,
UINT* pStrides,
UINT* pOffsets);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE IAGetIndexBuffer(
ID3D11Buffer** ppIndexBuffer,
DXGI_FORMAT* pFormat,
UINT* pOffset);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSSetShader(
2017-10-11 09:51:48 +02:00
ID3D11VertexShader* pVertexShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSSetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
void STDMETHODCALLTYPE VSSetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSSetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView* const* ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSSetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSGetShader(
2017-10-11 09:51:48 +02:00
ID3D11VertexShader** ppVertexShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSGetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers);
void STDMETHODCALLTYPE VSGetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSGetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView** ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE VSGetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSSetShader(
2017-10-11 09:51:48 +02:00
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSSetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView* const* ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSSetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE HSSetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSSetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSGetShader(
2017-10-11 09:51:48 +02:00
ID3D11HullShader** ppHullShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSGetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers);
void STDMETHODCALLTYPE HSGetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSGetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView** ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE HSGetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSSetShader(
2017-10-11 09:51:48 +02:00
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSSetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView* const* ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSSetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
void STDMETHODCALLTYPE DSSetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSSetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSGetShader(
2017-10-11 09:51:48 +02:00
ID3D11DomainShader** ppDomainShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSGetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE DSGetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSGetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView** ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE DSGetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSSetShader(
2017-10-11 09:51:48 +02:00
ID3D11GeometryShader* pShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSSetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE GSSetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSSetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView* const* ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSSetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSGetShader(
2017-10-11 09:51:48 +02:00
ID3D11GeometryShader** ppGeometryShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSGetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE GSGetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSGetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView** ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE GSGetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSSetShader(
2017-10-11 09:51:48 +02:00
ID3D11PixelShader* pPixelShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSSetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
void STDMETHODCALLTYPE PSSetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSSetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView* const* ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSSetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSGetShader(
2017-10-11 09:51:48 +02:00
ID3D11PixelShader** ppPixelShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSGetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE PSGetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSGetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView** ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE PSGetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSSetShader(
2017-10-11 09:51:48 +02:00
ID3D11ComputeShader* pComputeShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSSetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE CSSetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSSetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView* const* ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSSetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSSetUnorderedAccessViews(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumUAVs,
ID3D11UnorderedAccessView* const* ppUnorderedAccessViews,
const UINT* pUAVInitialCounts);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSGetShader(
2017-10-11 09:51:48 +02:00
ID3D11ComputeShader** ppComputeShader,
ID3D11ClassInstance** ppClassInstances,
UINT* pNumClassInstances);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSGetConstantBuffers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE CSGetConstantBuffers1(
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSGetShaderResources(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumViews,
ID3D11ShaderResourceView** ppShaderResourceViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSGetSamplers(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState** ppSamplers);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE CSGetUnorderedAccessViews(
2017-10-11 09:51:48 +02:00
UINT StartSlot,
UINT NumUAVs,
ID3D11UnorderedAccessView** ppUnorderedAccessViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMSetRenderTargets(
2017-10-11 09:51:48 +02:00
UINT NumViews,
ID3D11RenderTargetView* const* ppRenderTargetViews,
ID3D11DepthStencilView* pDepthStencilView);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMSetRenderTargetsAndUnorderedAccessViews(
2017-10-11 09:51:48 +02:00
UINT NumRTVs,
ID3D11RenderTargetView* const* ppRenderTargetViews,
ID3D11DepthStencilView* pDepthStencilView,
UINT UAVStartSlot,
UINT NumUAVs,
ID3D11UnorderedAccessView* const* ppUnorderedAccessViews,
const UINT* pUAVInitialCounts);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMSetBlendState(
2017-10-11 09:51:48 +02:00
ID3D11BlendState* pBlendState,
const FLOAT BlendFactor[4],
UINT SampleMask);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMSetDepthStencilState(
2017-10-11 09:51:48 +02:00
ID3D11DepthStencilState* pDepthStencilState,
UINT StencilRef);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMGetRenderTargets(
2017-10-11 09:51:48 +02:00
UINT NumViews,
ID3D11RenderTargetView** ppRenderTargetViews,
ID3D11DepthStencilView** ppDepthStencilView);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMGetRenderTargetsAndUnorderedAccessViews(
2017-10-11 09:51:48 +02:00
UINT NumRTVs,
ID3D11RenderTargetView** ppRenderTargetViews,
ID3D11DepthStencilView** ppDepthStencilView,
UINT UAVStartSlot,
UINT NumUAVs,
ID3D11UnorderedAccessView** ppUnorderedAccessViews);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMGetBlendState(
2017-10-11 09:51:48 +02:00
ID3D11BlendState** ppBlendState,
FLOAT BlendFactor[4],
UINT* pSampleMask);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE OMGetDepthStencilState(
2017-10-11 09:51:48 +02:00
ID3D11DepthStencilState** ppDepthStencilState,
UINT* pStencilRef);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE RSSetState(
ID3D11RasterizerState* pRasterizerState);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE RSSetViewports(
2017-10-11 09:51:48 +02:00
UINT NumViewports,
const D3D11_VIEWPORT* pViewports);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE RSSetScissorRects(
2017-10-11 09:51:48 +02:00
UINT NumRects,
const D3D11_RECT* pRects);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE RSGetState(
ID3D11RasterizerState** ppRasterizerState);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE RSGetViewports(
2017-10-11 09:51:48 +02:00
UINT* pNumViewports,
D3D11_VIEWPORT* pViewports);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE RSGetScissorRects(
2017-10-11 09:51:48 +02:00
UINT* pNumRects,
D3D11_RECT* pRects);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE SOSetTargets(
2017-10-11 09:51:48 +02:00
UINT NumBuffers,
ID3D11Buffer* const* ppSOTargets,
const UINT* pOffsets);
2017-10-11 09:51:48 +02:00
2017-12-12 12:50:52 +01:00
void STDMETHODCALLTYPE SOGetTargets(
2017-10-11 09:51:48 +02:00
UINT NumBuffers,
ID3D11Buffer** ppSOTargets);
2017-10-11 09:51:48 +02:00
void STDMETHODCALLTYPE SOGetTargetsWithOffsets(
UINT NumBuffers,
ID3D11Buffer** ppSOTargets,
UINT* pOffsets);
BOOL STDMETHODCALLTYPE IsAnnotationEnabled();
void STDMETHODCALLTYPE SetMarkerInt(
LPCWSTR pLabel,
INT Data);
void STDMETHODCALLTYPE BeginEventInt(
LPCWSTR pLabel,
INT Data);
void STDMETHODCALLTYPE EndEvent();
2019-09-16 13:12:13 +02:00
void STDMETHODCALLTYPE GetHardwareProtectionState(
BOOL* pHwProtectionEnable);
void STDMETHODCALLTYPE SetHardwareProtectionState(
BOOL HwProtectionEnable);
void STDMETHODCALLTYPE TransitionSurfaceLayout(
IDXGIVkInteropSurface* pSurface,
const VkImageSubresourceRange* pSubresources,
VkImageLayout OldLayout,
VkImageLayout NewLayout);
protected:
2017-10-11 09:51:48 +02:00
D3D11Device* const m_parent;
D3D11DeviceContextExt m_contextExt;
D3D11UserDefinedAnnotation m_annotation;
D3D10Multithread m_multithread;
Rc<DxvkDevice> m_device;
Rc<DxvkDataBuffer> m_updateBuffer;
DxvkCsChunkFlags m_csFlags;
DxvkCsChunkRef m_csChunk;
D3D11ContextState m_state;
D3D11CmdData* m_cmdData;
2018-03-10 11:44:27 +01:00
void ApplyInputLayout();
void ApplyPrimitiveTopology();
void ApplyBlendState();
void ApplyBlendFactor();
void ApplyDepthStencilState();
void ApplyStencilRef();
void ApplyRasterizerState();
2018-03-10 11:44:27 +01:00
void ApplyViewportState();
template<DxbcProgramType ShaderStage>
void BindShader(
const D3D11CommonShader* pShaderModule);
void BindFramebuffer();
void BindDrawBuffers(
D3D11Buffer* pBufferForArgs,
D3D11Buffer* pBufferForCount);
void BindVertexBuffer(
UINT Slot,
D3D11Buffer* pBuffer,
UINT Offset,
UINT Stride);
void BindIndexBuffer(
D3D11Buffer* pBuffer,
UINT Offset,
DXGI_FORMAT Format);
void BindXfbBuffer(
UINT Slot,
D3D11Buffer* pBuffer,
UINT Offset);
void BindConstantBuffer(
UINT Slot,
D3D11Buffer* pBuffer);
void BindConstantBuffer1(
UINT Slot,
D3D11Buffer* pBuffer,
UINT Offset,
UINT Length);
void BindSampler(
UINT Slot,
D3D11SamplerState* pSampler);
void BindShaderResource(
UINT Slot,
D3D11ShaderResourceView* pResource);
void BindUnorderedAccessView(
UINT UavSlot,
D3D11UnorderedAccessView* pUav,
UINT CtrSlot,
UINT Counter);
void DiscardBuffer(
D3D11Buffer* pBuffer);
void DiscardTexture(
D3D11CommonTexture* pTexture);
void SetDrawBuffers(
ID3D11Buffer* pBufferForArgs,
ID3D11Buffer* pBufferForCount);
template<DxbcProgramType ShaderStage>
void SetConstantBuffers(
D3D11ConstantBufferBindings& Bindings,
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers);
template<DxbcProgramType ShaderStage>
void SetConstantBuffers1(
D3D11ConstantBufferBindings& Bindings,
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer* const* ppConstantBuffers,
const UINT* pFirstConstant,
const UINT* pNumConstants);
template<DxbcProgramType ShaderStage>
void SetSamplers(
D3D11SamplerBindings& Bindings,
2017-12-09 21:17:26 +01:00
UINT StartSlot,
UINT NumSamplers,
ID3D11SamplerState* const* ppSamplers);
template<DxbcProgramType ShaderStage>
void SetShaderResources(
D3D11ShaderResourceBindings& Bindings,
UINT StartSlot,
UINT NumResources,
ID3D11ShaderResourceView* const* ppResources);
void GetConstantBuffers(
const D3D11ConstantBufferBindings& Bindings,
UINT StartSlot,
UINT NumBuffers,
ID3D11Buffer** ppConstantBuffers,
UINT* pFirstConstant,
UINT* pNumConstants);
void ResetState();
void RestoreState();
template<DxbcProgramType Stage>
void RestoreConstantBuffers(
D3D11ConstantBufferBindings& Bindings);
template<DxbcProgramType Stage>
void RestoreSamplers(
D3D11SamplerBindings& Bindings);
template<DxbcProgramType Stage>
void RestoreShaderResources(
D3D11ShaderResourceBindings& Bindings);
template<DxbcProgramType Stage>
void RestoreUnorderedAccessViews(
D3D11UnorderedAccessBindings& Bindings);
void UpdateMappedBuffer(
const D3D11CommonTexture* pTexture,
VkImageSubresource Subresource);
bool TestRtvUavHazards(
UINT NumRTVs,
ID3D11RenderTargetView* const* ppRTVs,
UINT NumUAVs,
ID3D11UnorderedAccessView* const* ppUAVs);
template<DxbcProgramType ShaderStage>
bool TestSrvHazards(
D3D11ShaderResourceView* pView);
template<DxbcProgramType ShaderStage, typename T>
void ResolveSrvHazards(
T* pView,
D3D11ShaderResourceBindings& Bindings);
template<typename T>
void ResolveCsSrvHazards(
T* pView);
template<typename T>
void ResolveOmSrvHazards(
T* pView);
bool ResolveOmRtvHazards(
D3D11UnorderedAccessView* pView);
void ResolveOmUavHazards(
D3D11RenderTargetView* pView);
bool ValidateRenderTargets(
UINT NumViews,
ID3D11RenderTargetView* const* ppRenderTargetViews,
ID3D11DepthStencilView* pDepthStencilView);
VkClearValue ConvertColorValue(
const FLOAT Color[4],
const DxvkFormatInfo* pFormatInfo);
DxvkDataSlice AllocUpdateBufferSlice(size_t Size);
DxvkCsChunkRef AllocCsChunk();
static void InitDefaultPrimitiveTopology(
DxvkInputAssemblyState* pIaState);
static void InitDefaultRasterizerState(
DxvkRasterizerState* pRsState);
static void InitDefaultDepthStencilState(
DxvkDepthStencilState* pDsState);
static void InitDefaultBlendState(
DxvkBlendMode* pCbState,
DxvkLogicOpState* pLoState,
DxvkMultisampleState* pMsState,
UINT SampleMask);
template<typename T>
const D3D11CommonShader* GetCommonShader(T* pShader) const {
return pShader != nullptr ? pShader->GetCommonShader() : nullptr;
}
D3D10DeviceLock LockContext() {
return m_multithread.AcquireLock();
}
template<typename Cmd>
void EmitCs(Cmd&& command) {
m_cmdData = nullptr;
if (unlikely(!m_csChunk->push(command))) {
EmitCsChunk(std::move(m_csChunk));
m_csChunk = AllocCsChunk();
m_csChunk->push(command);
}
}
template<typename M, typename Cmd, typename... Args>
M* EmitCsCmd(Cmd&& command, Args&&... args) {
M* data = m_csChunk->pushCmd<M, Cmd, Args...>(
command, std::forward<Args>(args)...);
if (unlikely(!data)) {
EmitCsChunk(std::move(m_csChunk));
m_csChunk = AllocCsChunk();
data = m_csChunk->pushCmd<M, Cmd, Args...>(
command, std::forward<Args>(args)...);
}
m_cmdData = data;
return data;
}
void FlushCsChunk() {
if (likely(!m_csChunk->empty())) {
EmitCsChunk(std::move(m_csChunk));
m_csChunk = AllocCsChunk();
m_cmdData = nullptr;
}
}
virtual void EmitCsChunk(DxvkCsChunkRef&& chunk) = 0;
2017-10-11 09:51:48 +02:00
};
}