summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2020-06-08 20:24:16 -0300
committerGravatar ReinUsesLisp2020-06-08 20:24:16 -0300
commit7646f2c21dcd3e36073142da84d56cd7640476a9 (patch)
tree3d0612fda7ade815bb3b0cf90cc9374419913497 /src
parentbuffer_cache: Return stream buffer invalidation in Map instead of Unmap (diff)
downloadyuzu-7646f2c21dcd3e36073142da84d56cd7640476a9.tar.gz
yuzu-7646f2c21dcd3e36073142da84d56cd7640476a9.tar.xz
yuzu-7646f2c21dcd3e36073142da84d56cd7640476a9.zip
gl_rasterizer: Mark vertex buffers as dirty after buffer cache invalidation
Vertex buffers bindings become invalid after the stream buffer is invalidated. We were originally doing this, but it got lost at some point. - Fixes Animal Crossing: New Horizons, but it affects everything.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 55e79aaf6..5673e30b3 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -576,7 +576,16 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) {
576 (Maxwell::MaxConstBufferSize + device.GetUniformBufferAlignment()); 576 (Maxwell::MaxConstBufferSize + device.GetUniformBufferAlignment());
577 577
578 // Prepare the vertex array. 578 // Prepare the vertex array.
579 buffer_cache.Map(buffer_size); 579 const bool invalidated = buffer_cache.Map(buffer_size);
580
581 if (invalidated) {
582 // When the stream buffer has been invalidated, we have to consider vertex buffers as dirty
583 auto& dirty = gpu.dirty.flags;
584 dirty[Dirty::VertexBuffers] = true;
585 for (int index = Dirty::VertexBuffer0; index <= Dirty::VertexBuffer31; ++index) {
586 dirty[index] = true;
587 }
588 }
580 589
581 // Prepare vertex array format. 590 // Prepare vertex array format.
582 SetupVertexFormat(); 591 SetupVertexFormat();