diff options
| author | Stenzek <stenzek@gmail.com> | 2017-09-09 18:30:15 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-09-11 20:01:54 +1000 |
| commit | 24ddea04ce3c843dd1de3d34d775e9a49d195225 (patch) | |
| tree | 5fb17c3d07988499767c51908b49dac2d8d9c881 /Source/Core/VideoBackends/Vulkan/ShaderCache.cpp | |
| parent | 340aabbb06404481b8a496f506ebc9bae75fad6c (diff) | |
VideoBackends: Move SamplerState to common
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/ShaderCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/ShaderCache.cpp | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp b/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp index 9bd41b882f..ad5cdf523a 100644 --- a/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp +++ b/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp @@ -977,18 +977,6 @@ std::string ShaderCache::GetUtilityShaderHeader() const return ss.str(); } -// Comparison operators for PipelineInfos -// Since these all boil down to POD types, we can just memcmp the entire thing for speed -// The is_trivially_copyable check fails on MSVC due to BitField. -// TODO: Can we work around this any way? -#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5 && !defined(_MSC_VER) -static_assert(std::has_trivial_copy_constructor<PipelineInfo>::value, - "PipelineInfo is trivially copyable"); -#elif !defined(_MSC_VER) -static_assert(std::is_trivially_copyable<PipelineInfo>::value, - "PipelineInfo is trivially copyable"); -#endif - std::size_t PipelineInfoHash::operator()(const PipelineInfo& key) const { return static_cast<std::size_t>(XXH64(&key, sizeof(key), 0)); @@ -1014,26 +1002,6 @@ bool operator>(const PipelineInfo& lhs, const PipelineInfo& rhs) return std::memcmp(&lhs, &rhs, sizeof(lhs)) > 0; } -bool operator==(const SamplerState& lhs, const SamplerState& rhs) -{ - return lhs.bits == rhs.bits; -} - -bool operator!=(const SamplerState& lhs, const SamplerState& rhs) -{ - return !operator==(lhs, rhs); -} - -bool operator>(const SamplerState& lhs, const SamplerState& rhs) -{ - return lhs.bits > rhs.bits; -} - -bool operator<(const SamplerState& lhs, const SamplerState& rhs) -{ - return lhs.bits < rhs.bits; -} - std::size_t ComputePipelineInfoHash::operator()(const ComputePipelineInfo& key) const { return static_cast<std::size_t>(XXH64(&key, sizeof(key), 0)); @@ -1214,7 +1182,8 @@ void ShaderCache::CreateDummyPipeline(const UberShader::VertexShaderUid& vuid, pinfo.depth_state.hex = RenderState::GetNoDepthTestingDepthStencilState().hex; pinfo.blend_state.hex = RenderState::GetNoBlendingBlendState().hex; pinfo.multisampling_state.hex = FramebufferManager::GetInstance()->GetEFBMultisamplingState().hex; - pinfo.rasterization_state.primitive = guid.GetUidData()->primitive_type; + pinfo.rasterization_state.primitive = + static_cast<PrimitiveType>(guid.GetUidData()->primitive_type); GetPipelineWithCacheResultAsync(pinfo); } |
