dirty_flags.h 1.5 KB

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