2024-03-06 06:26:38 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
2022-04-23 10:59:50 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2019-12-27 02:14:10 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-02-21 05:56:00 +01:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <iterator>
|
|
|
|
|
2019-12-27 02:14:10 +01:00
|
|
|
#include "common/common_types.h"
|
2020-02-21 05:56:00 +01:00
|
|
|
#include "video_core/engines/maxwell_3d.h"
|
2019-12-27 02:14:10 +01:00
|
|
|
|
|
|
|
namespace VideoCommon::Dirty {
|
|
|
|
|
|
|
|
enum : u8 {
|
|
|
|
NullEntry = 0,
|
|
|
|
|
2020-12-30 06:25:23 +01:00
|
|
|
Descriptors,
|
|
|
|
|
2019-12-27 02:14:10 +01:00
|
|
|
RenderTargets,
|
2020-12-30 06:25:23 +01:00
|
|
|
RenderTargetControl,
|
2019-12-27 02:14:10 +01:00
|
|
|
ColorBuffer0,
|
|
|
|
ColorBuffer1,
|
|
|
|
ColorBuffer2,
|
|
|
|
ColorBuffer3,
|
|
|
|
ColorBuffer4,
|
|
|
|
ColorBuffer5,
|
|
|
|
ColorBuffer6,
|
|
|
|
ColorBuffer7,
|
|
|
|
ZetaBuffer,
|
2021-07-20 19:36:38 +02:00
|
|
|
RescaleViewports,
|
|
|
|
RescaleScissors,
|
2019-12-27 02:14:10 +01:00
|
|
|
|
2021-01-17 00:48:58 +01:00
|
|
|
VertexBuffers,
|
|
|
|
VertexBuffer0,
|
|
|
|
VertexBuffer31 = VertexBuffer0 + 31,
|
|
|
|
|
|
|
|
IndexBuffer,
|
|
|
|
|
2021-04-24 23:27:25 +02:00
|
|
|
Shaders,
|
|
|
|
|
2021-09-23 03:14:10 +02:00
|
|
|
// Special entries
|
|
|
|
DepthBiasGlobal,
|
|
|
|
|
2019-12-27 02:14:10 +01:00
|
|
|
LastCommonEntry,
|
|
|
|
};
|
|
|
|
|
2020-02-21 05:56:00 +01:00
|
|
|
template <typename Integer>
|
2020-02-22 00:44:39 +01:00
|
|
|
void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Table& table, std::size_t begin,
|
|
|
|
std::size_t num, Integer dirty_index) {
|
2020-02-21 05:56:00 +01:00
|
|
|
const auto it = std::begin(table) + begin;
|
|
|
|
std::fill(it, it + num, static_cast<u8>(dirty_index));
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename Integer1, typename Integer2>
|
2020-02-22 00:44:39 +01:00
|
|
|
void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables, std::size_t begin,
|
|
|
|
std::size_t num, Integer1 index_a, Integer2 index_b) {
|
2020-02-21 05:56:00 +01:00
|
|
|
FillBlock(tables[0], begin, num, index_a);
|
|
|
|
FillBlock(tables[1], begin, num, index_b);
|
|
|
|
}
|
|
|
|
|
2021-01-17 00:48:58 +01:00
|
|
|
void SetupDirtyFlags(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables);
|
2020-02-21 05:56:00 +01:00
|
|
|
|
2019-12-27 02:14:10 +01:00
|
|
|
} // namespace VideoCommon::Dirty
|