pineapple-src/src/video_core/dirty_flags.h

65 lines
1.4 KiB
C
Raw Normal View History

2022-04-23 14:49:07 -04:00
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2020-12-28 10:15:37 -05:00
#pragma once
#include <algorithm>
#include <cstddef>
#include <iterator>
#include "common/common_types.h"
#include "video_core/engines/maxwell_3d.h"
namespace VideoCommon::Dirty {
enum : u8 {
NullEntry = 0,
Descriptors,
RenderTargets,
RenderTargetControl,
ColorBuffer0,
ColorBuffer1,
ColorBuffer2,
ColorBuffer3,
ColorBuffer4,
ColorBuffer5,
ColorBuffer6,
ColorBuffer7,
ZetaBuffer,
2021-10-24 00:39:01 -04:00
RescaleViewports,
RescaleScissors,
2020-12-28 10:15:37 -05:00
2021-01-16 21:19:34 -05:00
VertexBuffers,
VertexBuffer0,
VertexBuffer31 = VertexBuffer0 + 31,
IndexBuffer,
2021-07-09 17:54:15 -04:00
Shaders,
2021-09-22 22:22:03 -04:00
// Special entries
DepthBiasGlobal,
2020-12-28 10:15:37 -05:00
LastCommonEntry,
};
template <typename Integer>
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>
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);
}
2021-01-16 21:19:34 -05:00
void SetupDirtyFlags(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables);
2020-12-28 10:15:37 -05:00
} // namespace VideoCommon::Dirty