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"
|
2017-01-29 02:57:24 +05:30
|
|
|
#include "video_core/regs_pipeline.h"
|
2016-04-28 22:31:47 +05:30
|
|
|
|
|
|
|
namespace Pica {
|
|
|
|
|
2016-04-30 21:04:51 +05:30
|
|
|
namespace DebugUtils {
|
|
|
|
class MemoryAccessTracker;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Shader {
|
2016-12-19 06:12:19 +05:30
|
|
|
struct AttributeBuffer;
|
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;
|
2017-01-29 02:04:31 +05:30
|
|
|
explicit VertexLoader(const PipelineRegs& regs) {
|
2016-04-29 20:53:40 +05:30
|
|
|
Setup(regs);
|
|
|
|
}
|
|
|
|
|
2017-01-29 02:04:31 +05:30
|
|
|
void Setup(const PipelineRegs& regs);
|
2016-12-19 06:12:19 +05:30
|
|
|
void LoadVertex(u32 base_address, int index, int vertex, Shader::AttributeBuffer& input,
|
2016-09-18 06:08:01 +05:30
|
|
|
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{};
|
2017-01-29 02:04:31 +05:30
|
|
|
std::array<PipelineRegs::VertexAttributeFormat, 16> vertex_attribute_formats;
|
2016-04-29 20:36:03 +05:30
|
|
|
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
|