1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d11] Implement ID3D11DeviceContext2

We don't support tiled resources nor markers for now.
Marker support could be added through debug layers.
This commit is contained in:
Philip Rebohle 2019-09-15 18:40:08 +02:00
parent 6e28ab956d
commit c1a7243811
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 168 additions and 5 deletions

View File

@ -54,7 +54,8 @@ namespace dxvk {
if (riid == __uuidof(IUnknown)
|| riid == __uuidof(ID3D11DeviceChild)
|| riid == __uuidof(ID3D11DeviceContext)
|| riid == __uuidof(ID3D11DeviceContext1)) {
|| riid == __uuidof(ID3D11DeviceContext1)
|| riid == __uuidof(ID3D11DeviceContext2)) {
*ppvObject = ref(this);
return S_OK;
}
@ -712,6 +713,55 @@ namespace dxvk {
}
void STDMETHODCALLTYPE D3D11DeviceContext::CopyTiles(
ID3D11Resource* pTiledResource,
const D3D11_TILED_RESOURCE_COORDINATE* pTileRegionStartCoordinate,
const D3D11_TILE_REGION_SIZE* pTileRegionSize,
ID3D11Buffer* pBuffer,
UINT64 BufferStartOffsetInBytes,
UINT Flags) {
static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::CopyTiles: Not implemented");
}
HRESULT STDMETHODCALLTYPE D3D11DeviceContext::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) {
static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::CopyTileMappings: Not implemented");
return DXGI_ERROR_INVALID_CALL;
}
HRESULT STDMETHODCALLTYPE D3D11DeviceContext::ResizeTilePool(
ID3D11Buffer* pTilePool,
UINT64 NewSizeInBytes) {
static bool s_errorShown = false;
if (!std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::ResizeTilePool: Not implemented");
return DXGI_ERROR_INVALID_CALL;
}
void STDMETHODCALLTYPE D3D11DeviceContext::TiledResourceBarrier(
ID3D11DeviceChild* pTiledResourceOrViewAccessBeforeBarrier,
ID3D11DeviceChild* pTiledResourceOrViewAccessAfterBarrier) {
}
void STDMETHODCALLTYPE D3D11DeviceContext::ClearRenderTargetView(
ID3D11RenderTargetView* pRenderTargetView,
const FLOAT ColorRGBA[4]) {
@ -1252,6 +1302,39 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE D3D11DeviceContext::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) {
bool s_errorShown = false;
if (std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::UpdateTileMappings: Not implemented");
return DXGI_ERROR_INVALID_CALL;
}
void STDMETHODCALLTYPE D3D11DeviceContext::UpdateTiles(
ID3D11Resource* pDestTiledResource,
const D3D11_TILED_RESOURCE_COORDINATE* pDestTileRegionStartCoordinate,
const D3D11_TILE_REGION_SIZE* pDestTileRegionSize,
const void* pSourceTileData,
UINT Flags) {
bool s_errorShown = false;
if (std::exchange(s_errorShown, true))
Logger::err("D3D11DeviceContext::UpdateTiles: Not implemented");
}
void STDMETHODCALLTYPE D3D11DeviceContext::SetResourceMinLOD(
ID3D11Resource* pResource,
FLOAT MinLOD) {
@ -3016,6 +3099,31 @@ namespace dxvk {
}
BOOL STDMETHODCALLTYPE D3D11DeviceContext::IsAnnotationEnabled() {
// Not implemented in the backend
return FALSE;
}
void STDMETHODCALLTYPE D3D11DeviceContext::SetMarkerInt(
LPCWSTR pLabel,
INT Data) {
// Not implemented in the backend, ignore
}
void STDMETHODCALLTYPE D3D11DeviceContext::BeginEventInt(
LPCWSTR pLabel,
INT Data) {
// Not implemented in the backend, ignore
}
void STDMETHODCALLTYPE D3D11DeviceContext::EndEvent() {
// Not implemented in the backend, ignore
}
void STDMETHODCALLTYPE D3D11DeviceContext::TransitionSurfaceLayout(
IDXGIVkInteropSurface* pSurface,
const VkImageSubresourceRange* pSubresources,

View File

@ -17,7 +17,7 @@ namespace dxvk {
class D3D11Device;
class D3D11DeviceContext : public D3D11DeviceChild<ID3D11DeviceContext1> {
class D3D11DeviceContext : public D3D11DeviceChild<ID3D11DeviceContext2> {
friend class D3D11DeviceContextExt;
public:
@ -86,6 +86,30 @@ namespace dxvk {
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);
void STDMETHODCALLTYPE ClearRenderTargetView(
ID3D11RenderTargetView* pRenderTargetView,
const FLOAT ColorRGBA[4]);
@ -130,6 +154,25 @@ namespace dxvk {
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);
void STDMETHODCALLTYPE SetResourceMinLOD(
ID3D11Resource* pResource,
FLOAT MinLOD);
@ -637,6 +680,18 @@ namespace dxvk {
ID3D11Buffer** ppSOTargets,
UINT* pOffsets);
BOOL STDMETHODCALLTYPE IsAnnotationEnabled();
void STDMETHODCALLTYPE SetMarkerInt(
LPCWSTR pLabel,
INT Data);
void STDMETHODCALLTYPE BeginEventInt(
LPCWSTR pLabel,
INT Data);
void STDMETHODCALLTYPE EndEvent();
void STDMETHODCALLTYPE TransitionSurfaceLayout(
IDXGIVkInteropSurface* pSurface,
const VkImageSubresourceRange* pSubresources,