GraphicsMemory default alignment is now 16-byte
This commit is contained in:
Родитель
a3748828d6
Коммит
7128144097
|
@ -122,7 +122,7 @@ namespace DirectX
|
|||
// Make sure to keep the GraphicsResource handle alive as long as you need to access
|
||||
// the memory on the CPU. For example, do not simply cache GpuAddress() and discard
|
||||
// the GraphicsResource object, or your memory may be overwritten later.
|
||||
GraphicsResource __cdecl Allocate(size_t size, size_t alignment = 0);
|
||||
GraphicsResource __cdecl Allocate(size_t size, size_t alignment = 16);
|
||||
|
||||
// Special overload of Allocate that aligns to D3D12 constant buffer alignment requirements
|
||||
template<typename T> GraphicsResource AllocateConstant()
|
||||
|
|
|
@ -261,8 +261,10 @@ GraphicsMemory::~GraphicsMemory()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
GraphicsResource GraphicsMemory::Allocate(size_t size, size_t alignment)
|
||||
{
|
||||
assert(alignment >= 4); // Should use at least DWORD alignment
|
||||
return std::move(pImpl->Allocate(size, alignment));
|
||||
}
|
||||
|
||||
|
@ -272,6 +274,7 @@ void GraphicsMemory::Commit(_In_ ID3D12CommandQueue* commandQueue)
|
|||
pImpl->Commit(commandQueue);
|
||||
}
|
||||
|
||||
|
||||
void GraphicsMemory::GarbageCollect()
|
||||
{
|
||||
pImpl->GarbageCollect();
|
||||
|
|
Загрузка…
Ссылка в новой задаче