yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

texture_cache: Minor changes

This commit is contained in:
ReinUsesLisp 2019-09-05 23:25:15 -03:00
parent 322d0200c8
commit 7228e22098
4 changed files with 17 additions and 19 deletions

View File

@ -195,18 +195,18 @@ public:
virtual void DownloadTexture(std::vector<u8>& staging_buffer) = 0; 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; is_modified = is_modified_ || is_target;
modification_tick = tick; modification_tick = tick;
} }
void MarkAsRenderTarget(const bool is_target, const u32 index) { void MarkAsRenderTarget(bool is_target_, u32 index_) {
this->is_target = is_target; is_target = is_target_;
this->index = index; index = index_;
} }
void MarkAsPicked(const bool is_picked) { void MarkAsPicked(bool is_picked_) {
this->is_picked = is_picked; is_picked = is_picked_;
} }
bool IsModified() const { bool IsModified() const {

View File

@ -4,8 +4,6 @@
#pragma once #pragma once
#include <map>
#include "common/alignment.h" #include "common/alignment.h"
#include "common/bit_util.h" #include "common/bit_util.h"
#include "common/cityhash.h" #include "common/cityhash.h"

View File

@ -10,7 +10,7 @@
namespace VideoCommon { namespace VideoCommon {
std::size_t ViewParams::Hash() const { 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>(base_level) << 24) ^
(static_cast<std::size_t>(num_levels) << 32) ^ (static_cast<std::size_t>(target) << 36); (static_cast<std::size_t>(num_levels) << 32) ^ (static_cast<std::size_t>(target) << 36);
} }

View File

@ -13,8 +13,8 @@
namespace VideoCommon { namespace VideoCommon {
struct ViewParams { struct ViewParams {
ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer, u32 num_layers, constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer,
u32 base_level, u32 num_levels) u32 num_layers, u32 base_level, u32 num_levels)
: target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level}, : target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level},
num_levels{num_levels} {} num_levels{num_levels} {}
@ -22,12 +22,6 @@ struct ViewParams {
bool operator==(const ViewParams& rhs) const; 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 { bool IsLayered() const {
switch (target) { switch (target) {
case VideoCore::Surface::SurfaceTarget::Texture1DArray: case VideoCore::Surface::SurfaceTarget::Texture1DArray:
@ -39,13 +33,19 @@ struct ViewParams {
return false; return false;
} }
} }
VideoCore::Surface::SurfaceTarget target{};
u32 base_layer{};
u32 num_layers{};
u32 base_level{};
u32 num_levels{};
}; };
class ViewBase { class ViewBase {
public: 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; return params;
} }