From 272517cf7ebb08afa7ff524394124f9d061bba52 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 21 Sep 2018 16:14:15 -0400 Subject: shader_bytecode: Make operator== and operator!= of IpaMode const qualified These don't affect the state of the struct and can be const member functions. --- src/video_core/engines/shader_bytecode.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 7e1de0fa1..acd6f5b21 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -5,9 +5,8 @@ #pragma once #include -#include -#include #include +#include #include #include @@ -321,11 +320,13 @@ enum class IpaSampleMode : u64 { Default = 0, Centroid = 1, Offset = 2 }; struct IpaMode { IpaInterpMode interpolation_mode; IpaSampleMode sampling_mode; - inline bool operator==(const IpaMode& a) { - return (a.interpolation_mode == interpolation_mode) && (a.sampling_mode == sampling_mode); + + bool operator==(const IpaMode& a) const { + return std::tie(interpolation_mode, sampling_mode) == + std::tie(a.interpolation_mode, a.sampling_mode); } - inline bool operator!=(const IpaMode& a) { - return !((*this) == a); + bool operator!=(const IpaMode& a) const { + return !operator==(a); } }; -- cgit v1.2.3 From a8f5fd787fa6b7d2c120bf9b7fbfa840738db1a3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 21 Sep 2018 16:15:29 -0400 Subject: shader_bytecode: Lay out the Ipa-related enums better This is more consistent with the surrounding enums. --- src/video_core/engines/shader_bytecode.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index acd6f5b21..b1f137b9c 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -314,8 +314,18 @@ enum class TextureMiscMode : u64 { PTP, }; -enum class IpaInterpMode : u64 { Linear = 0, Perspective = 1, Flat = 2, Sc = 3 }; -enum class IpaSampleMode : u64 { Default = 0, Centroid = 1, Offset = 2 }; +enum class IpaInterpMode : u64 { + Linear = 0, + Perspective = 1, + Flat = 2, + Sc = 3, +}; + +enum class IpaSampleMode : u64 { + Default = 0, + Centroid = 1, + Offset = 2, +}; struct IpaMode { IpaInterpMode interpolation_mode; -- cgit v1.2.3