mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[d3d11] Implement tile pool creation
This commit is contained in:
parent
0cd67cb98a
commit
e8f59bfd7c
@ -73,16 +73,24 @@ namespace dxvk {
|
||||
| VK_BUFFER_CREATE_SPARSE_ALIASED_BIT;
|
||||
}
|
||||
|
||||
// Create the buffer and set the entire buffer slice as mapped,
|
||||
// so that we only have to update it when invalidating th buffer
|
||||
m_buffer = m_parent->GetDXVKDevice()->createBuffer(info, GetMemoryFlags());
|
||||
m_mapped = m_buffer->getSliceHandle();
|
||||
if (!(pDesc->MiscFlags & D3D11_RESOURCE_MISC_TILE_POOL)) {
|
||||
// Create the buffer and set the entire buffer slice as mapped,
|
||||
// so that we only have to update it when invalidating the buffer
|
||||
m_buffer = m_parent->GetDXVKDevice()->createBuffer(info, GetMemoryFlags());
|
||||
m_mapped = m_buffer->getSliceHandle();
|
||||
|
||||
m_mapMode = DetermineMapMode();
|
||||
m_mapMode = DetermineMapMode();
|
||||
|
||||
// For Stream Output buffers we need a counter
|
||||
if (pDesc->BindFlags & D3D11_BIND_STREAM_OUTPUT)
|
||||
m_soCounter = CreateSoCounterBuffer();
|
||||
// For Stream Output buffers we need a counter
|
||||
if (pDesc->BindFlags & D3D11_BIND_STREAM_OUTPUT)
|
||||
m_soCounter = CreateSoCounterBuffer();
|
||||
} else {
|
||||
m_sparseAllocator = m_parent->GetDXVKDevice()->createSparsePageAllocator();
|
||||
m_sparseAllocator->setCapacity(info.size / SparseMemoryPageSize);
|
||||
|
||||
m_mapped = DxvkBufferSliceHandle();
|
||||
m_mapMode = D3D11_COMMON_BUFFER_MAP_MODE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,6 +73,10 @@ namespace dxvk {
|
||||
Rc<DxvkBuffer> GetBuffer() const {
|
||||
return m_buffer;
|
||||
}
|
||||
|
||||
Rc<DxvkSparsePageAllocator> GetSparseAllocator() const {
|
||||
return m_sparseAllocator;
|
||||
}
|
||||
|
||||
DxvkBufferSlice GetBufferSlice() const {
|
||||
return DxvkBufferSlice(m_buffer, 0, m_desc.ByteWidth);
|
||||
@ -152,6 +156,7 @@ namespace dxvk {
|
||||
|
||||
Rc<DxvkBuffer> m_buffer;
|
||||
Rc<DxvkBuffer> m_soCounter;
|
||||
Rc<DxvkSparsePageAllocator> m_sparseAllocator;
|
||||
DxvkBufferSliceHandle m_mapped;
|
||||
uint64_t m_seq = 0ull;
|
||||
|
||||
|
@ -95,7 +95,10 @@ namespace dxvk {
|
||||
|
||||
try {
|
||||
const Com<D3D11Buffer> buffer = new D3D11Buffer(this, &desc);
|
||||
m_initializer->InitBuffer(buffer.ptr(), pInitialData);
|
||||
|
||||
if (!(desc.MiscFlags & D3D11_RESOURCE_MISC_TILE_POOL))
|
||||
m_initializer->InitBuffer(buffer.ptr(), pInitialData);
|
||||
|
||||
*ppBuffer = buffer.ref();
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user