Merge pull request #8874 from vonchenplus/align_index_buffer_size

Align index buffe size when vertex_buffer_unified_memory enable
This commit is contained in:
bunnei 2022-10-01 10:28:50 -07:00 committed by GitHub
commit 4242064560
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -168,7 +168,7 @@ void BufferCacheRuntime::BindIndexBuffer(Buffer& buffer, u32 offset, u32 size) {
if (has_unified_vertex_buffers) {
buffer.MakeResident(GL_READ_ONLY);
glBufferAddressRangeNV(GL_ELEMENT_ARRAY_ADDRESS_NV, 0, buffer.HostGpuAddr() + offset,
static_cast<GLsizeiptr>(size));
static_cast<GLsizeiptr>(Common::AlignUp(size, 4)));
} else {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffer.Handle());
index_buffer_offset = offset;