mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +01:00
[d3d11] Implement ResizeTilePool
This commit is contained in:
parent
e8f59bfd7c
commit
5130638ebe
@ -66,6 +66,10 @@ namespace dxvk {
|
|||||||
return &m_desc;
|
return &m_desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL IsTilePool() const {
|
||||||
|
return bool(m_desc.MiscFlags & D3D11_RESOURCE_MISC_TILE_POOL);
|
||||||
|
}
|
||||||
|
|
||||||
D3D11_COMMON_BUFFER_MAP_MODE GetMapMode() const {
|
D3D11_COMMON_BUFFER_MAP_MODE GetMapMode() const {
|
||||||
return m_mapMode;
|
return m_mapMode;
|
||||||
}
|
}
|
||||||
|
@ -2656,12 +2656,24 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE D3D11CommonContext<ContextType>::ResizeTilePool(
|
HRESULT STDMETHODCALLTYPE D3D11CommonContext<ContextType>::ResizeTilePool(
|
||||||
ID3D11Buffer* pTilePool,
|
ID3D11Buffer* pTilePool,
|
||||||
UINT64 NewSizeInBytes) {
|
UINT64 NewSizeInBytes) {
|
||||||
static bool s_errorShown = false;
|
if (NewSizeInBytes % SparseMemoryPageSize)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
if (!std::exchange(s_errorShown, true))
|
auto buffer = static_cast<D3D11Buffer*>(pTilePool);
|
||||||
Logger::err("D3D11DeviceContext::ResizeTilePool: Not implemented");
|
|
||||||
|
|
||||||
return DXGI_ERROR_INVALID_CALL;
|
if (!buffer->IsTilePool())
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
// Perform the resize operation. This is somewhat trivialized
|
||||||
|
// since all lifetime tracking is done by the backend.
|
||||||
|
EmitCs([
|
||||||
|
cAllocator = buffer->GetSparseAllocator(),
|
||||||
|
cPageCount = NewSizeInBytes / SparseMemoryPageSize
|
||||||
|
] (DxvkContext* ctx) {
|
||||||
|
cAllocator->setCapacity(cPageCount);
|
||||||
|
});
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user