dirty_flags.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <algorithm>
  6. #include <cstddef>
  7. #include <iterator>
  8. #include "common/common_types.h"
  9. #include "video_core/engines/maxwell_3d.h"
  10. namespace VideoCommon::Dirty {
  11. enum : u8 {
  12. NullEntry = 0,
  13. RenderTargets,
  14. ColorBuffer0,
  15. ColorBuffer1,
  16. ColorBuffer2,
  17. ColorBuffer3,
  18. ColorBuffer4,
  19. ColorBuffer5,
  20. ColorBuffer6,
  21. ColorBuffer7,
  22. ZetaBuffer,
  23. LastCommonEntry,
  24. };
  25. template <typename Integer>
  26. void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Table& table, std::size_t begin,
  27. std::size_t num, Integer dirty_index) {
  28. const auto it = std::begin(table) + begin;
  29. std::fill(it, it + num, static_cast<u8>(dirty_index));
  30. }
  31. template <typename Integer1, typename Integer2>
  32. void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables, std::size_t begin,
  33. std::size_t num, Integer1 index_a, Integer2 index_b) {
  34. FillBlock(tables[0], begin, num, index_a);
  35. FillBlock(tables[1], begin, num, index_b);
  36. }
  37. void SetupDirtyRenderTargets(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables);
  38. } // namespace VideoCommon::Dirty