summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_graphics_pipeline.h10
2 files changed, 8 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
index 92974ba08..ad61a17a5 100644
--- a/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
+++ b/src/video_core/renderer_opengl/gl_graphics_pipeline.cpp
@@ -3,9 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <cstring>
7 6
8#include "common/cityhash.h"
9#include "common/thread_worker.h" 7#include "common/thread_worker.h"
10#include "shader_recompiler/shader_info.h" 8#include "shader_recompiler/shader_info.h"
11#include "video_core/renderer_opengl/gl_graphics_pipeline.h" 9#include "video_core/renderer_opengl/gl_graphics_pipeline.h"
@@ -176,14 +174,6 @@ ConfigureFuncPtr ConfigureFunc(const std::array<Shader::Info, 5>& infos, u32 ena
176} 174}
177} // Anonymous namespace 175} // Anonymous namespace
178 176
179size_t GraphicsPipelineKey::Hash() const noexcept {
180 return static_cast<size_t>(Common::CityHash64(reinterpret_cast<const char*>(this), Size()));
181}
182
183bool GraphicsPipelineKey::operator==(const GraphicsPipelineKey& rhs) const noexcept {
184 return std::memcmp(this, &rhs, Size()) == 0;
185}
186
187GraphicsPipeline::GraphicsPipeline( 177GraphicsPipeline::GraphicsPipeline(
188 const Device& device, TextureCache& texture_cache_, BufferCache& buffer_cache_, 178 const Device& device, TextureCache& texture_cache_, BufferCache& buffer_cache_,
189 Tegra::MemoryManager& gpu_memory_, Tegra::Engines::Maxwell3D& maxwell3d_, 179 Tegra::MemoryManager& gpu_memory_, Tegra::Engines::Maxwell3D& maxwell3d_,
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 @@
5#pragma once 5#pragma once
6 6
7#include <array> 7#include <array>
8#include <cstring>
8#include <type_traits> 9#include <type_traits>
9#include <utility> 10#include <utility>
10 11
11#include "common/bit_field.h" 12#include "common/bit_field.h"
13#include "common/cityhash.h"
12#include "common/common_types.h" 14#include "common/common_types.h"
13#include "shader_recompiler/shader_info.h" 15#include "shader_recompiler/shader_info.h"
14#include "video_core/engines/maxwell_3d.h" 16#include "video_core/engines/maxwell_3d.h"
@@ -44,9 +46,13 @@ struct GraphicsPipelineKey {
44 std::array<u32, 3> padding; 46 std::array<u32, 3> padding;
45 VideoCommon::TransformFeedbackState xfb_state; 47 VideoCommon::TransformFeedbackState xfb_state;
46 48
47 size_t Hash() const noexcept; 49 size_t Hash() const noexcept {
50 return static_cast<size_t>(Common::CityHash64(reinterpret_cast<const char*>(this), Size()));
51 }
48 52
49 bool operator==(const GraphicsPipelineKey&) const noexcept; 53 bool operator==(const GraphicsPipelineKey& rhs) const noexcept {
54 return std::memcmp(this, &rhs, Size()) == 0;
55 }
50 56
51 bool operator!=(const GraphicsPipelineKey& rhs) const noexcept { 57 bool operator!=(const GraphicsPipelineKey& rhs) const noexcept {
52 return !operator==(rhs); 58 return !operator==(rhs);