VertexLoaderARM64.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2015 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <utility>
  5. #include "Common/Arm64Emitter.h"
  6. #include "Common/CommonTypes.h"
  7. #include "VideoCommon/VertexLoaderBase.h"
  8. enum class VertexComponentFormat;
  9. enum class ComponentFormat;
  10. enum class ColorFormat;
  11. enum class CPArray : u8;
  12. class VertexLoaderARM64 : public VertexLoaderBase, public Arm64Gen::ARM64CodeBlock
  13. {
  14. public:
  15. VertexLoaderARM64(const TVtxDesc& vtx_desc, const VAT& vtx_att);
  16. protected:
  17. int RunVertices(const u8* src, u8* dst, int count) override;
  18. private:
  19. u32 m_src_ofs = 0;
  20. u32 m_dst_ofs = 0;
  21. Arm64Gen::FixupBranch m_skip_vertex;
  22. Arm64Gen::ARM64FloatEmitter m_float_emit;
  23. std::pair<Arm64Gen::ARM64Reg, u32> GetVertexAddr(CPArray array, VertexComponentFormat attribute);
  24. void ReadVertex(VertexComponentFormat attribute, ComponentFormat format, int count_in,
  25. int count_out, bool dequantize, u8 scaling_exponent,
  26. AttributeFormat* native_format, Arm64Gen::ARM64Reg reg, u32 offset);
  27. void ReadColor(VertexComponentFormat attribute, ColorFormat format, Arm64Gen::ARM64Reg reg,
  28. u32 offset);
  29. void GenerateVertexLoader();
  30. };