dirty_flags.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. Descriptors,
  14. RenderTargets,
  15. RenderTargetControl,
  16. ColorBuffer0,
  17. ColorBuffer1,
  18. ColorBuffer2,
  19. ColorBuffer3,
  20. ColorBuffer4,
  21. ColorBuffer5,
  22. ColorBuffer6,
  23. ColorBuffer7,
  24. ZetaBuffer,
  25. LastCommonEntry,
  26. };
  27. template <typename Integer>
  28. void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Table& table, std::size_t begin,
  29. std::size_t num, Integer dirty_index) {
  30. const auto it = std::begin(table) + begin;
  31. std::fill(it, it + num, static_cast<u8>(dirty_index));
  32. }
  33. template <typename Integer1, typename Integer2>
  34. void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables, std::size_t begin,
  35. std::size_t num, Integer1 index_a, Integer2 index_b) {
  36. FillBlock(tables[0], begin, num, index_a);
  37. FillBlock(tables[1], begin, num, index_b);
  38. }
  39. void SetupDirtyRenderTargets(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables);
  40. } // namespace VideoCommon::Dirty