diff options
| author | 2020-04-19 01:25:52 -0300 | |
|---|---|---|
| committer | 2020-04-21 19:55:44 -0300 | |
| commit | 0bbae63300fc83505d34f5ca3f9a5be10e42d7c7 (patch) | |
| tree | a7a1b11034b64ca73adea93260efe0d98bc30707 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #3718 from ReinUsesLisp/better-pipeline-state (diff) | |
| download | yuzu-0bbae63300fc83505d34f5ca3f9a5be10e42d7c7.tar.gz yuzu-0bbae63300fc83505d34f5ca3f9a5be10e42d7c7.tar.xz yuzu-0bbae63300fc83505d34f5ca3f9a5be10e42d7c7.zip | |
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.
https://github.com/devkitPro/deko3d/blob/1d1930beea093b5a663419e93b0649719a3ca5da/source/maxwell/gpu_3d_vbo.cpp#L62-L63
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 71007bbe8..2ebf34fc4 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -834,8 +834,8 @@ void RasterizerVulkan::SetupVertexArrays(FixedPipelineState::VertexInput& vertex | |||
| 834 | const GPUVAddr start{vertex_array.StartAddress()}; | 834 | const GPUVAddr start{vertex_array.StartAddress()}; |
| 835 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; | 835 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; |
| 836 | 836 | ||
| 837 | ASSERT(end > start); | 837 | ASSERT(end >= start); |
| 838 | const std::size_t size{end - start + 1}; | 838 | const std::size_t size{end - start}; |
| 839 | const auto [buffer, offset] = buffer_cache.UploadMemory(start, size); | 839 | const auto [buffer, offset] = buffer_cache.UploadMemory(start, size); |
| 840 | buffer_bindings.AddVertexBinding(buffer, offset); | 840 | buffer_bindings.AddVertexBinding(buffer, offset); |
| 841 | } | 841 | } |
| @@ -1179,7 +1179,7 @@ std::size_t RasterizerVulkan::CalculateVertexArraysSize() const { | |||
| 1179 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; | 1179 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; |
| 1180 | DEBUG_ASSERT(end >= start); | 1180 | DEBUG_ASSERT(end >= start); |
| 1181 | 1181 | ||
| 1182 | size += (end - start + 1) * regs.vertex_array[index].enable; | 1182 | size += (end - start) * regs.vertex_array[index].enable; |
| 1183 | } | 1183 | } |
| 1184 | return size; | 1184 | return size; |
| 1185 | } | 1185 | } |