2016-04-28 22:31:47 +05:30
|
|
|
#pragma once
|
|
|
|
|
2016-04-29 20:36:03 +05:30
|
|
|
#include <array>
|
|
|
|
#include "common/common_types.h"
|
2016-04-28 22:31:47 +05:30
|
|
|
#include "video_core/pica.h"
|
|
|
|
|
|
|
|
namespace Pica {
|
|
|
|
|
2016-04-30 21:04:51 +05:30
|
|
|
namespace DebugUtils {
|
|
|
|
class MemoryAccessTracker;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Shader {
|
2016-05-09 08:34:42 +05:30
|
|
|
struct InputVertex;
|
2016-04-30 21:04:51 +05:30
|
|
|
}
|
|
|
|
|
2016-04-28 22:31:47 +05:30
|
|
|
class VertexLoader {
|
|
|
|
public:
|
2016-04-29 20:53:40 +05:30
|
|
|
VertexLoader() = default;
|
|
|
|
explicit VertexLoader(const Pica::Regs& regs) {
|
|
|
|
Setup(regs);
|
|
|
|
}
|
|
|
|
|
2016-04-28 23:10:11 +05:30
|
|
|
void Setup(const Pica::Regs& regs);
|
2016-09-18 06:08:01 +05:30
|
|
|
void LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input,
|
|
|
|
DebugUtils::MemoryAccessTracker& memory_accesses);
|
2016-04-28 22:31:47 +05:30
|
|
|
|
2016-09-18 06:08:01 +05:30
|
|
|
int GetNumTotalAttributes() const {
|
|
|
|
return num_total_attributes;
|
|
|
|
}
|
2016-04-28 23:47:35 +05:30
|
|
|
|
2016-04-28 22:31:47 +05:30
|
|
|
private:
|
2016-04-29 20:36:03 +05:30
|
|
|
std::array<u32, 16> vertex_attribute_sources;
|
|
|
|
std::array<u32, 16> vertex_attribute_strides{};
|
|
|
|
std::array<Regs::VertexAttributeFormat, 16> vertex_attribute_formats;
|
|
|
|
std::array<u32, 16> vertex_attribute_elements{};
|
|
|
|
std::array<bool, 16> vertex_attribute_is_default;
|
2016-04-29 20:46:52 +05:30
|
|
|
int num_total_attributes = 0;
|
2016-04-29 20:57:15 +05:30
|
|
|
bool is_setup = false;
|
2016-04-28 22:31:47 +05:30
|
|
|
};
|
|
|
|
|
2016-09-18 06:08:01 +05:30
|
|
|
} // namespace Pica
|