2016-04-28 17:01:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-04-29 15:06:03 +00:00
|
|
|
#include <array>
|
2016-04-28 17:40:11 +00:00
|
|
|
|
2016-04-29 15:06:03 +00:00
|
|
|
#include "common/common_types.h"
|
2016-04-28 17:01:47 +00:00
|
|
|
#include "video_core/pica.h"
|
|
|
|
|
|
|
|
namespace Pica {
|
|
|
|
|
2016-04-30 15:34:51 +00:00
|
|
|
namespace DebugUtils {
|
|
|
|
class MemoryAccessTracker;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Shader {
|
|
|
|
class InputVertex;
|
|
|
|
}
|
|
|
|
|
2016-04-28 17:01:47 +00:00
|
|
|
class VertexLoader {
|
|
|
|
public:
|
2016-04-29 15:23:40 +00:00
|
|
|
VertexLoader() = default;
|
|
|
|
explicit VertexLoader(const Pica::Regs& regs) {
|
|
|
|
Setup(regs);
|
|
|
|
}
|
|
|
|
|
2016-04-28 17:40:11 +00:00
|
|
|
void Setup(const Pica::Regs& regs);
|
2016-04-29 06:50:21 +00:00
|
|
|
void LoadVertex(u32 base_address, int index, int vertex, Shader::InputVertex& input, DebugUtils::MemoryAccessTracker& memory_accesses);
|
2016-04-28 17:01:47 +00:00
|
|
|
|
|
|
|
int GetNumTotalAttributes() const { return num_total_attributes; }
|
2016-04-28 18:17:35 +00:00
|
|
|
|
2016-04-28 17:01:47 +00:00
|
|
|
private:
|
2016-04-29 15:06:03 +00:00
|
|
|
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 15:16:52 +00:00
|
|
|
int num_total_attributes = 0;
|
2016-04-28 17:01:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Pica
|