aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_opengl/gl_device.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-11-02 04:08:31 -0300
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-11-02 05:05:34 -0300
commit76ca2a5f82f4df64cb839af42c93acb6705411ae (patch)
tree22ef46bef8f32d8b2aa2f3928a96b30b3f69e213 /src/video_core/renderer_opengl/gl_device.h
parent11e39da02bec92fe4a332bfb737323ccb8087626 (diff)
gl_rasterizer: Upload constant buffers with glNamedBufferSubData
Nvidia's OpenGL driver maps gl(Named)BufferSubData with some requirements to a fast. This path has an extra memcpy but updates the buffer without orphaning or waiting for previous calls. It can be seen as a better model for "push constants" that can upload a whole UBO instead of 256 bytes. This path has some requirements established here: http://on-demand.gputechconf.com/gtc/2014/presentations/S4379-opengl-44-scene-rendering-techniques.pdf#page=24 Instead of using the stream buffer, this commits moves constant buffers uploads to calls of glNamedBufferSubData and from my testing it brings a performance improvement. This is disabled when the vendor is not Nvidia since it brings performance regressions.
Diffstat (limited to 'src/video_core/renderer_opengl/gl_device.h')
-rw-r--r--src/video_core/renderer_opengl/gl_device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h
index bb273c3d6..bf35bd0b6 100644
--- a/src/video_core/renderer_opengl/gl_device.h
+++ b/src/video_core/renderer_opengl/gl_device.h
@@ -54,6 +54,10 @@ public:
return has_precise_bug;
}
+ bool HasFastBufferSubData() const {
+ return has_fast_buffer_sub_data;
+ }
+
private:
static bool TestVariableAoffi();
static bool TestComponentIndexingBug();
@@ -69,6 +73,7 @@ private:
bool has_variable_aoffi{};
bool has_component_indexing_bug{};
bool has_precise_bug{};
+ bool has_fast_buffer_sub_data{};
};
} // namespace OpenGL