summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_graphics_pipeline.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-20 07:35:30 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:39 +0200
commit9bd05313849f76fc64406d5ebf3aadf39fa3bfde (patch)
tree3f944306fc429aa11265a3f6119001d005ba5182 /src/video_core/renderer_opengl/gl_graphics_pipeline.h
parentgl_shader_cache: Check previous pipeline before checking hash map (diff)
downloadyuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.tar
yuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.tar.gz
yuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.tar.bz2
yuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.tar.lz
yuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.tar.xz
yuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.tar.zst
yuzu-9bd05313849f76fc64406d5ebf3aadf39fa3bfde.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.h b/src/video_core/renderer_opengl/gl_graphics_pipeline.h
index a033d4a95..f82d712f8 100644
--- a/src/video_core/renderer_opengl/gl_graphics_pipeline.h
+++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.h
@@ -5,10 +5,12 @@
#pragma once
#include <array>
+#include <cstring>
#include <type_traits>
#include <utility>
#include "common/bit_field.h"
+#include "common/cityhash.h"
#include "common/common_types.h"
#include "shader_recompiler/shader_info.h"
#include "video_core/engines/maxwell_3d.h"
@@ -44,9 +46,13 @@ struct GraphicsPipelineKey {
std::array<u32, 3> padding;
VideoCommon::TransformFeedbackState xfb_state;
- size_t Hash() const noexcept;
+ size_t Hash() const noexcept {
+ return static_cast<size_t>(Common::CityHash64(reinterpret_cast<const char*>(this), Size()));
+ }
- bool operator==(const GraphicsPipelineKey&) const noexcept;
+ bool operator==(const GraphicsPipelineKey& rhs) const noexcept {
+ return std::memcmp(this, &rhs, Size()) == 0;
+ }
bool operator!=(const GraphicsPipelineKey& rhs) const noexcept {
return !operator==(rhs);