summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-09-06 04:25:15 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-09-06 04:25:15 +0200
commit7228e22098dd97ac89b78484a4f3ee855e37f799 (patch)
treefb8689f49635886aafbff8c4e2fc84dc6d08587c /src/video_core
parentgl_rasterizer: Apply textures and images state (diff)
downloadyuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.tar
yuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.tar.gz
yuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.tar.bz2
yuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.tar.lz
yuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.tar.xz
yuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.tar.zst
yuzu-7228e22098dd97ac89b78484a4f3ee855e37f799.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/texture_cache/surface_base.h12
-rw-r--r--src/video_core/texture_cache/surface_params.h2
-rw-r--r--src/video_core/texture_cache/surface_view.cpp2
-rw-r--r--src/video_core/texture_cache/surface_view.h20
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:
virtual void DownloadTexture(std::vector<u8>& staging_buffer) = 0;
- void MarkAsModified(const bool is_modified_, const u64 tick) {
+ void MarkAsModified(bool is_modified_, u64 tick) {
is_modified = is_modified_ || is_target;
modification_tick = tick;
}
- void MarkAsRenderTarget(const bool is_target, const u32 index) {
- this->is_target = is_target;
- this->index = index;
+ void MarkAsRenderTarget(bool is_target_, u32 index_) {
+ is_target = is_target_;
+ index = index_;
}
- void MarkAsPicked(const bool is_picked) {
- this->is_picked = is_picked;
+ void MarkAsPicked(bool is_picked_) {
+ is_picked = is_picked_;
}
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 @@
#pragma once
-#include <map>
-
#include "common/alignment.h"
#include "common/bit_util.h"
#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 @@
namespace VideoCommon {
std::size_t ViewParams::Hash() const {
- return static_cast<std::size_t>(base_layer) ^ static_cast<std::size_t>(num_layers << 16) ^
+ return static_cast<std::size_t>(base_layer) ^ (static_cast<std::size_t>(num_layers) << 16) ^
(static_cast<std::size_t>(base_level) << 24) ^
(static_cast<std::size_t>(num_levels) << 32) ^ (static_cast<std::size_t>(target) << 36);
}
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 @@
namespace VideoCommon {
struct ViewParams {
- ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer, u32 num_layers,
- u32 base_level, u32 num_levels)
+ constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer,
+ u32 num_layers, u32 base_level, u32 num_levels)
: target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level},
num_levels{num_levels} {}
@@ -22,12 +22,6 @@ struct ViewParams {
bool operator==(const ViewParams& rhs) const;
- VideoCore::Surface::SurfaceTarget target{};
- u32 base_layer{};
- u32 num_layers{};
- u32 base_level{};
- u32 num_levels{};
-
bool IsLayered() const {
switch (target) {
case VideoCore::Surface::SurfaceTarget::Texture1DArray:
@@ -39,13 +33,19 @@ struct ViewParams {
return false;
}
}
+
+ VideoCore::Surface::SurfaceTarget target{};
+ u32 base_layer{};
+ u32 num_layers{};
+ u32 base_level{};
+ u32 num_levels{};
};
class ViewBase {
public:
- ViewBase(const ViewParams& params) : params{params} {}
+ constexpr explicit ViewBase(const ViewParams& params) : params{params} {}
- const ViewParams& GetViewParams() const {
+ constexpr const ViewParams& GetViewParams() const {
return params;
}