diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/texture_cache/surface_base.h | 12 | ||||
| -rw-r--r-- | src/video_core/texture_cache/surface_params.h | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/surface_view.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/surface_view.h | 20 |
4 files changed, 17 insertions, 19 deletions
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h index bcce8d863..5e497e49f 100644 --- a/src/video_core/texture_cache/surface_base.h +++ b/src/video_core/texture_cache/surface_base.h | |||
| @@ -195,18 +195,18 @@ public: | |||
| 195 | 195 | ||
| 196 | virtual void DownloadTexture(std::vector<u8>& staging_buffer) = 0; | 196 | virtual void DownloadTexture(std::vector<u8>& staging_buffer) = 0; |
| 197 | 197 | ||
| 198 | void MarkAsModified(const bool is_modified_, const u64 tick) { | 198 | void MarkAsModified(bool is_modified_, u64 tick) { |
| 199 | is_modified = is_modified_ || is_target; | 199 | is_modified = is_modified_ || is_target; |
| 200 | modification_tick = tick; | 200 | modification_tick = tick; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | void MarkAsRenderTarget(const bool is_target, const u32 index) { | 203 | void MarkAsRenderTarget(bool is_target_, u32 index_) { |
| 204 | this->is_target = is_target; | 204 | is_target = is_target_; |
| 205 | this->index = index; | 205 | index = index_; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | void MarkAsPicked(const bool is_picked) { | 208 | void MarkAsPicked(bool is_picked_) { |
| 209 | this->is_picked = is_picked; | 209 | is_picked = is_picked_; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | bool IsModified() const { | 212 | bool IsModified() const { |
diff --git a/src/video_core/texture_cache/surface_params.h b/src/video_core/texture_cache/surface_params.h index 1011a4d8e..c58e7f8a4 100644 --- a/src/video_core/texture_cache/surface_params.h +++ b/src/video_core/texture_cache/surface_params.h | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <map> | ||
| 8 | |||
| 9 | #include "common/alignment.h" | 7 | #include "common/alignment.h" |
| 10 | #include "common/bit_util.h" | 8 | #include "common/bit_util.h" |
| 11 | #include "common/cityhash.h" | 9 | #include "common/cityhash.h" |
diff --git a/src/video_core/texture_cache/surface_view.cpp b/src/video_core/texture_cache/surface_view.cpp index 467696a4c..57a1f5803 100644 --- a/src/video_core/texture_cache/surface_view.cpp +++ b/src/video_core/texture_cache/surface_view.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | namespace VideoCommon { | 10 | namespace VideoCommon { |
| 11 | 11 | ||
| 12 | std::size_t ViewParams::Hash() const { | 12 | std::size_t ViewParams::Hash() const { |
| 13 | return static_cast<std::size_t>(base_layer) ^ static_cast<std::size_t>(num_layers << 16) ^ | 13 | return static_cast<std::size_t>(base_layer) ^ (static_cast<std::size_t>(num_layers) << 16) ^ |
| 14 | (static_cast<std::size_t>(base_level) << 24) ^ | 14 | (static_cast<std::size_t>(base_level) << 24) ^ |
| 15 | (static_cast<std::size_t>(num_levels) << 32) ^ (static_cast<std::size_t>(target) << 36); | 15 | (static_cast<std::size_t>(num_levels) << 32) ^ (static_cast<std::size_t>(target) << 36); |
| 16 | } | 16 | } |
diff --git a/src/video_core/texture_cache/surface_view.h b/src/video_core/texture_cache/surface_view.h index 04ca5639b..b17fd11a9 100644 --- a/src/video_core/texture_cache/surface_view.h +++ b/src/video_core/texture_cache/surface_view.h | |||
| @@ -13,8 +13,8 @@ | |||
| 13 | namespace VideoCommon { | 13 | namespace VideoCommon { |
| 14 | 14 | ||
| 15 | struct ViewParams { | 15 | struct ViewParams { |
| 16 | ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer, u32 num_layers, | 16 | constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer, |
| 17 | u32 base_level, u32 num_levels) | 17 | u32 num_layers, u32 base_level, u32 num_levels) |
| 18 | : target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level}, | 18 | : target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level}, |
| 19 | num_levels{num_levels} {} | 19 | num_levels{num_levels} {} |
| 20 | 20 | ||
| @@ -22,12 +22,6 @@ struct ViewParams { | |||
| 22 | 22 | ||
| 23 | bool operator==(const ViewParams& rhs) const; | 23 | bool operator==(const ViewParams& rhs) const; |
| 24 | 24 | ||
| 25 | VideoCore::Surface::SurfaceTarget target{}; | ||
| 26 | u32 base_layer{}; | ||
| 27 | u32 num_layers{}; | ||
| 28 | u32 base_level{}; | ||
| 29 | u32 num_levels{}; | ||
| 30 | |||
| 31 | bool IsLayered() const { | 25 | bool IsLayered() const { |
| 32 | switch (target) { | 26 | switch (target) { |
| 33 | case VideoCore::Surface::SurfaceTarget::Texture1DArray: | 27 | case VideoCore::Surface::SurfaceTarget::Texture1DArray: |
| @@ -39,13 +33,19 @@ struct ViewParams { | |||
| 39 | return false; | 33 | return false; |
| 40 | } | 34 | } |
| 41 | } | 35 | } |
| 36 | |||
| 37 | VideoCore::Surface::SurfaceTarget target{}; | ||
| 38 | u32 base_layer{}; | ||
| 39 | u32 num_layers{}; | ||
| 40 | u32 base_level{}; | ||
| 41 | u32 num_levels{}; | ||
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | class ViewBase { | 44 | class ViewBase { |
| 45 | public: | 45 | public: |
| 46 | ViewBase(const ViewParams& params) : params{params} {} | 46 | constexpr explicit ViewBase(const ViewParams& params) : params{params} {} |
| 47 | 47 | ||
| 48 | const ViewParams& GetViewParams() const { | 48 | constexpr const ViewParams& GetViewParams() const { |
| 49 | return params; | 49 | return params; |
| 50 | } | 50 | } |
| 51 | 51 | ||