2019-12-26 20:14:10 -05:00
|
|
|
// Copyright 2019 yuzu Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-02-20 23:56:00 -05:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <iterator>
|
|
|
|
|
2019-12-26 20:14:10 -05:00
|
|
|
#include "common/common_types.h"
|
2020-02-20 23:56:00 -05:00
|
|
|
#include "video_core/engines/maxwell_3d.h"
|
2019-12-26 20:14:10 -05:00
|
|
|
|
|
|
|
namespace VideoCommon::Dirty {
|
|
|
|
|
|
|
|
enum : u8 {
|
|
|
|
NullEntry = 0,
|
|
|
|
|
|
|
|
RenderTargets,
|
|
|
|
ColorBuffer0,
|
|
|
|
ColorBuffer1,
|
|
|
|
ColorBuffer2,
|
|
|
|
ColorBuffer3,
|
|
|
|
ColorBuffer4,
|
|
|
|
ColorBuffer5,
|
|
|
|
ColorBuffer6,
|
|
|
|
ColorBuffer7,
|
|
|
|
ZetaBuffer,
|
|
|
|
|
|
|
|
LastCommonEntry,
|
|
|
|
};
|
|
|
|
|
2020-02-20 23:56:00 -05:00
|
|
|
template <typename Integer>
|
|
|
|
inline void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Table& table, std::size_t begin,
|
|
|
|
std::size_t num, Integer dirty_index) {
|
|
|
|
const auto it = std::begin(table) + begin;
|
|
|
|
std::fill(it, it + num, static_cast<u8>(dirty_index));
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Integer1, typename Integer2>
|
|
|
|
inline void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables, std::size_t begin,
|
|
|
|
std::size_t num, Integer1 index_a, Integer2 index_b) {
|
|
|
|
FillBlock(tables[0], begin, num, index_a);
|
|
|
|
FillBlock(tables[1], begin, num, index_b);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetupCommonOnWriteStores(Tegra::Engines::Maxwell3D::DirtyState::Flags& store);
|
|
|
|
|
|
|
|
void SetupDirtyRenderTargets(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables);
|
|
|
|
|
2019-12-26 20:14:10 -05:00
|
|
|
} // namespace VideoCommon::Dirty
|