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