From 06d30fbcca92728655dad708be3bdc5a8f7ff54b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 15 Jan 2020 06:29:58 -0500 Subject: [PATCH 1/2] renderer_opengl/utils: Forward declare private structs Keeps the definitions hidden and allows changes to the structs without needing to recompile all users of classes containing said structs. --- src/video_core/renderer_opengl/utils.cpp | 14 ++++++++++++++ src/video_core/renderer_opengl/utils.h | 14 ++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/video_core/renderer_opengl/utils.cpp b/src/video_core/renderer_opengl/utils.cpp index 9770dda1c..39138621c 100644 --- a/src/video_core/renderer_opengl/utils.cpp +++ b/src/video_core/renderer_opengl/utils.cpp @@ -16,6 +16,13 @@ namespace OpenGL { +struct VertexArrayPushBuffer::Entry { + GLuint binding_index{}; + const GLuint* buffer{}; + GLintptr offset{}; + GLsizei stride{}; +}; + VertexArrayPushBuffer::VertexArrayPushBuffer() = default; VertexArrayPushBuffer::~VertexArrayPushBuffer() = default; @@ -47,6 +54,13 @@ void VertexArrayPushBuffer::Bind() { } } +struct BindBuffersRangePushBuffer::Entry { + GLuint binding; + const GLuint* buffer; + GLintptr offset; + GLsizeiptr size; +}; + BindBuffersRangePushBuffer::BindBuffersRangePushBuffer(GLenum target) : target{target} {} BindBuffersRangePushBuffer::~BindBuffersRangePushBuffer() = default; diff --git a/src/video_core/renderer_opengl/utils.h b/src/video_core/renderer_opengl/utils.h index d56153fe7..3ad7c02d4 100644 --- a/src/video_core/renderer_opengl/utils.h +++ b/src/video_core/renderer_opengl/utils.h @@ -26,12 +26,7 @@ public: void Bind(); private: - struct Entry { - GLuint binding_index{}; - const GLuint* buffer{}; - GLintptr offset{}; - GLsizei stride{}; - }; + struct Entry; GLuint vao{}; const GLuint* index_buffer{}; @@ -50,12 +45,7 @@ public: void Bind(); private: - struct Entry { - GLuint binding; - const GLuint* buffer; - GLintptr offset; - GLsizeiptr size; - }; + struct Entry; GLenum target; std::vector entries; From 7af56dfa7645249f9c5d420365ad78b44e43eadd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 15 Jan 2020 06:31:20 -0500 Subject: [PATCH 2/2] renderer_opengl/utils: Remove unused header inclusions Nothing from these headers are used, so they can be removed. --- src/video_core/renderer_opengl/utils.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/video_core/renderer_opengl/utils.cpp b/src/video_core/renderer_opengl/utils.cpp index 39138621c..ac99e6385 100644 --- a/src/video_core/renderer_opengl/utils.cpp +++ b/src/video_core/renderer_opengl/utils.cpp @@ -6,12 +6,9 @@ #include #include - #include -#include "common/assert.h" #include "common/common_types.h" -#include "common/scope_exit.h" #include "video_core/renderer_opengl/utils.h" namespace OpenGL {