dirty_flags.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. VertexBuffers,
  26. VertexBuffer0,
  27. VertexBuffer31 = VertexBuffer0 + 31,
  28. IndexBuffer,
  29. Shaders,
  30. LastCommonEntry,
  31. };
  32. template <typename Integer>
  33. void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Table& table, std::size_t begin,
  34. std::size_t num, Integer dirty_index) {
  35. const auto it = std::begin(table) + begin;
  36. std::fill(it, it + num, static_cast<u8>(dirty_index));
  37. }
  38. template <typename Integer1, typename Integer2>
  39. void FillBlock(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables, std::size_t begin,
  40. std::size_t num, Integer1 index_a, Integer2 index_b) {
  41. FillBlock(tables[0], begin, num, index_a);
  42. FillBlock(tables[1], begin, num, index_b);
  43. }
  44. void SetupDirtyFlags(Tegra::Engines::Maxwell3D::DirtyState::Tables& tables);
  45. } // namespace VideoCommon::Dirty