diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-26 23:32:59 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:33 +0200 |
commit | adb591a757ccb289634920d51cf519b515ca32b6 (patch) | |
tree | 987c5cd0a346e69633791ad5ec355b6104ab036e /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | glasm: Implement Y direction (diff) | |
download | yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.gz yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.bz2 yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.lz yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.xz yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.zst yuzu-adb591a757ccb289634920d51cf519b515ca32b6.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index eec01e8c2..5d4e80364 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -268,19 +268,21 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) { EndTransformFeedback(); ++num_queued_commands; + has_written_global_memory |= pipeline->WritesGlobalMemory(); gpu.TickWork(); } void RasterizerOpenGL::DispatchCompute() { - ComputePipeline* const program{shader_cache.CurrentComputePipeline()}; - if (!program) { + ComputePipeline* const pipeline{shader_cache.CurrentComputePipeline()}; + if (!pipeline) { return; } - program->Configure(); + pipeline->Configure(); const auto& qmd{kepler_compute.launch_description}; glDispatchCompute(qmd.grid_dim_x, qmd.grid_dim_y, qmd.grid_dim_z); ++num_queued_commands; + has_written_global_memory |= pipeline->WritesGlobalMemory(); } void RasterizerOpenGL::ResetCounter(VideoCore::QueryType type) { @@ -449,9 +451,8 @@ void RasterizerOpenGL::FlushCommands() { // Make sure memory stored from the previous GL command stream is visible // This is only needed on assembly shaders where we write to GPU memory with raw pointers - // TODO: Call this only when NV_shader_buffer_load or NV_shader_buffer_store have been used - // and prefer using NV_shader_storage_buffer_object when possible - if (Settings::values.use_assembly_shaders.GetValue()) { + if (has_written_global_memory) { + has_written_global_memory = false; glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT); } glFlush(); |