Align up the page count when applying single page mappings on D3D12

This commit is contained in:
baldurk
2022-04-15 11:45:35 +01:00
parent 75a7f66280
commit 9668cc9a4c
+2 -2
View File
@@ -437,8 +437,8 @@ SparseBinds::SparseBinds(const Sparse::PageTable &table)
bind.heap = mapping.singleMapping.memory;
bind.rangeOffset = uint32_t(mapping.singleMapping.offset / pageSize);
bind.rangeCount = uint32_t(table.isSubresourceInMipTail(sub)
? table.getMipTailSliceSize() / pageSize
: table.getSubresourceByteSize(sub) / pageSize);
? (table.getMipTailSliceSize() + pageSize - 1) / pageSize
: (table.getSubresourceByteSize(sub) + pageSize - 1) / pageSize);
bind.regionStart = {0, 0, 0, sub};
bind.regionSize = {bind.rangeCount, FALSE, bind.rangeCount, 1, 1};
bind.rangeFlag = D3D12_TILE_RANGE_FLAG_NONE;