summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-02-11 22:59:44 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-14 21:38:27 +0100
commitbcd348f2388cf944f2ac49364a8d13b47cc21456 (patch)
tree7aefb0077b4d8902bdab3f3026361173a71046e3 /src/video_core/renderer_opengl
parentquery_cache: Abstract OpenGL implementation (diff)
downloadyuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar
yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.gz
yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.bz2
yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.lz
yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.xz
yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.tar.zst
yuzu-bcd348f2388cf944f2ac49364a8d13b47cc21456.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_query_cache.cpp11
-rw-r--r--src/video_core/renderer_opengl/gl_query_cache.h11
2 files changed, 9 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_query_cache.cpp b/src/video_core/renderer_opengl/gl_query_cache.cpp
index 7d5a044c7..f12e9f55f 100644
--- a/src/video_core/renderer_opengl/gl_query_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_query_cache.cpp
@@ -31,15 +31,16 @@ constexpr GLenum GetTarget(VideoCore::QueryType type) {
} // Anonymous namespace
QueryCache::QueryCache(Core::System& system, RasterizerOpenGL& gl_rasterizer)
- : VideoCommon::QueryCacheBase<QueryCache, CachedQuery, CounterStream,
- HostCounter>{system, static_cast<VideoCore::RasterizerInterface&>(
- gl_rasterizer)},
+ : VideoCommon::QueryCacheBase<
+ QueryCache, CachedQuery, CounterStream, HostCounter,
+ std::vector<OGLQuery>>{system,
+ static_cast<VideoCore::RasterizerInterface&>(gl_rasterizer)},
gl_rasterizer{gl_rasterizer} {}
QueryCache::~QueryCache() = default;
OGLQuery QueryCache::AllocateQuery(VideoCore::QueryType type) {
- auto& reserve = queries_reserve[static_cast<std::size_t>(type)];
+ auto& reserve = query_pools[static_cast<std::size_t>(type)];
OGLQuery query;
if (reserve.empty()) {
query.Create(GetTarget(type));
@@ -52,7 +53,7 @@ OGLQuery QueryCache::AllocateQuery(VideoCore::QueryType type) {
}
void QueryCache::Reserve(VideoCore::QueryType type, OGLQuery&& query) {
- queries_reserve[static_cast<std::size_t>(type)].push_back(std::move(query));
+ query_pools[static_cast<std::size_t>(type)].push_back(std::move(query));
}
bool QueryCache::AnyCommandQueued() const noexcept {
diff --git a/src/video_core/renderer_opengl/gl_query_cache.h b/src/video_core/renderer_opengl/gl_query_cache.h
index 20d337f15..99d187837 100644
--- a/src/video_core/renderer_opengl/gl_query_cache.h
+++ b/src/video_core/renderer_opengl/gl_query_cache.h
@@ -6,12 +6,8 @@
#include <array>
#include <memory>
-#include <optional>
-#include <unordered_map>
#include <vector>
-#include <glad/glad.h>
-
#include "common/common_types.h"
#include "video_core/query_cache.h"
#include "video_core/rasterizer_interface.h"
@@ -30,8 +26,8 @@ class RasterizerOpenGL;
using CounterStream = VideoCommon::CounterStreamBase<QueryCache, HostCounter>;
-class QueryCache final
- : public VideoCommon::QueryCacheBase<QueryCache, CachedQuery, CounterStream, HostCounter> {
+class QueryCache final : public VideoCommon::QueryCacheBase<QueryCache, CachedQuery, CounterStream,
+ HostCounter, std::vector<OGLQuery>> {
public:
explicit QueryCache(Core::System& system, RasterizerOpenGL& rasterizer);
~QueryCache();
@@ -44,7 +40,6 @@ public:
private:
RasterizerOpenGL& gl_rasterizer;
- std::array<std::vector<OGLQuery>, VideoCore::NumQueryTypes> queries_reserve;
};
class HostCounter final : public VideoCommon::HostCounterBase<QueryCache, HostCounter> {
@@ -59,7 +54,7 @@ private:
u64 BlockingQuery() const override;
QueryCache& cache;
- VideoCore::QueryType type;
+ const VideoCore::QueryType type;
OGLQuery query;
};