1
0
Fork 0
forked from suyu/suyu

Align index buffe size when vertex_buffer_unified_memory enable

This commit is contained in:
FengChen 2022-09-10 20:01:33 +08:00
parent 16080b6e4e
commit 92b1f8d5da

View file

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