also align the size of buffers for pinned memory

This commit is contained in:
degasus 2013-02-04 20:48:28 +01:00
parent 6e0b0192a8
commit 2108529120
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ void StreamBuffer::Init()
for(u32 i=0; i<SYNC_POINTS; i++)
fences[i] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
pointer = (u8*)AllocateAlignedMemory(m_size, ALIGN_PINNED_MEMORY );
pointer = (u8*)AllocateAlignedMemory(ROUND_UP(m_size,ALIGN_PINNED_MEMORY), ALIGN_PINNED_MEMORY );
glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, m_buffer);
glBufferData(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, m_size, pointer, GL_STREAM_COPY);
glBindBuffer(GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD, 0);