vertex_loader.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include <array>
  3. #include "common/common_types.h"
  4. #include "video_core/regs_pipeline.h"
  5. namespace Pica {
  6. namespace DebugUtils {
  7. class MemoryAccessTracker;
  8. }
  9. namespace Shader {
  10. struct AttributeBuffer;
  11. }
  12. class VertexLoader {
  13. public:
  14. VertexLoader() = default;
  15. explicit VertexLoader(const PipelineRegs& regs) {
  16. Setup(regs);
  17. }
  18. void Setup(const PipelineRegs& regs);
  19. void LoadVertex(u32 base_address, int index, int vertex, Shader::AttributeBuffer& input,
  20. DebugUtils::MemoryAccessTracker& memory_accesses);
  21. int GetNumTotalAttributes() const {
  22. return num_total_attributes;
  23. }
  24. private:
  25. std::array<u32, 16> vertex_attribute_sources;
  26. std::array<u32, 16> vertex_attribute_strides{};
  27. std::array<PipelineRegs::VertexAttributeFormat, 16> vertex_attribute_formats;
  28. std::array<u32, 16> vertex_attribute_elements{};
  29. std::array<bool, 16> vertex_attribute_is_default;
  30. int num_total_attributes = 0;
  31. bool is_setup = false;
  32. };
  33. } // namespace Pica