mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-18 14:17:51 +00:00
gl_rasterizer: Fix buffers without size
On NVN buffers can be enabled but have no size. According to deko3d and
the behavior we see in Animal Crossing: New Horizons these buffers get
the special address of 0x1000 and limit themselves to 0xfff.
Implement buffers without a size by binding a null buffer to OpenGL
without a side.
1d1930beea/source/maxwell/gpu_3d_vbo.cpp (L62-L63)
This commit is contained in:
parent
89ba13c7d2
commit
b33a0c0d5f
3 changed files with 13 additions and 8 deletions
|
@ -834,8 +834,8 @@ void RasterizerVulkan::SetupVertexArrays(FixedPipelineState::VertexInput& vertex
|
|||
const GPUVAddr start{vertex_array.StartAddress()};
|
||||
const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()};
|
||||
|
||||
ASSERT(end > start);
|
||||
const std::size_t size{end - start + 1};
|
||||
ASSERT(end >= start);
|
||||
const std::size_t size{end - start};
|
||||
const auto [buffer, offset] = buffer_cache.UploadMemory(start, size);
|
||||
buffer_bindings.AddVertexBinding(buffer, offset);
|
||||
}
|
||||
|
@ -1179,7 +1179,7 @@ std::size_t RasterizerVulkan::CalculateVertexArraysSize() const {
|
|||
const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()};
|
||||
DEBUG_ASSERT(end >= start);
|
||||
|
||||
size += (end - start + 1) * regs.vertex_array[index].enable;
|
||||
size += (end - start) * regs.vertex_array[index].enable;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue