mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[d3d11] Implement ResizeTilePool
This commit is contained in:
parent
e8f59bfd7c
commit
5130638ebe
@ -66,6 +66,10 @@ namespace dxvk {
|
||||
return &m_desc;
|
||||
}
|
||||
|
||||
BOOL IsTilePool() const {
|
||||
return bool(m_desc.MiscFlags & D3D11_RESOURCE_MISC_TILE_POOL);
|
||||
}
|
||||
|
||||
D3D11_COMMON_BUFFER_MAP_MODE GetMapMode() const {
|
||||
return m_mapMode;
|
||||
}
|
||||
|
@ -2656,12 +2656,24 @@ namespace dxvk {
|
||||
HRESULT STDMETHODCALLTYPE D3D11CommonContext<ContextType>::ResizeTilePool(
|
||||
ID3D11Buffer* pTilePool,
|
||||
UINT64 NewSizeInBytes) {
|
||||
static bool s_errorShown = false;
|
||||
if (NewSizeInBytes % SparseMemoryPageSize)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (!std::exchange(s_errorShown, true))
|
||||
Logger::err("D3D11DeviceContext::ResizeTilePool: Not implemented");
|
||||
auto buffer = static_cast<D3D11Buffer*>(pTilePool);
|
||||
|
||||
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