2016-04-28 20:01:47 +03:00
|
|
|
#pragma once
|
|
|
|
|
2016-04-29 18:06:03 +03:00
|
|
|
#include <array>
|
|
|
|
#include "common/common_types.h"
|
2017-01-29 00:27:24 +03:00
|
|
|
#include "video_core/regs_pipeline.h"
|
2016-04-28 20:01:47 +03:00
|
|
|
|
|
|
|
namespace Pica {
|
|
|
|
|
2016-04-30 18:34:51 +03:00
|
|
|
namespace DebugUtils {
|
|
|
|
class MemoryAccessTracker;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Shader {
|
2016-12-19 03:42:19 +03:00
|
|
|
struct AttributeBuffer;
|
2016-04-30 18:34:51 +03:00
|
|
|
}
|
|
|
|
|
2016-04-28 20:01:47 +03:00
|
|
|
class VertexLoader {
|
|
|
|
public:
|
2016-04-29 18:23:40 +03:00
|
|
|
VertexLoader() = default;
|
2017-01-28 23:34:31 +03:00
|
|
|
explicit VertexLoader(const PipelineRegs& regs) {
|
2016-04-29 18:23:40 +03:00
|
|
|
Setup(regs);
|
|
|
|
}
|
|
|
|
|
2017-01-28 23:34:31 +03:00
|
|
|
void Setup(const PipelineRegs& regs);
|
2016-12-19 03:42:19 +03:00
|
|
|
void LoadVertex(u32 base_address, int index, int vertex, Shader::AttributeBuffer& input,
|
2016-09-18 03:38:01 +03:00
|
|
|
DebugUtils::MemoryAccessTracker& memory_accesses);
|
2016-04-28 20:01:47 +03:00
|
|
|
|
2016-09-18 03:38:01 +03:00
|
|
|
int GetNumTotalAttributes() const {
|
|
|
|
return num_total_attributes;
|
|
|
|
}
|
2016-04-28 21:17:35 +03:00
|
|
|
|
2016-04-28 20:01:47 +03:00
|
|
|
private:
|
2016-04-29 18:06:03 +03:00
|
|
|
std::array<u32, 16> vertex_attribute_sources;
|
|
|
|
std::array<u32, 16> vertex_attribute_strides{};
|
2017-01-28 23:34:31 +03:00
|
|
|
std::array<PipelineRegs::VertexAttributeFormat, 16> vertex_attribute_formats;
|
2016-04-29 18:06:03 +03:00
|
|
|
std::array<u32, 16> vertex_attribute_elements{};
|
|
|
|
std::array<bool, 16> vertex_attribute_is_default;
|
2016-04-29 18:16:52 +03:00
|
|
|
int num_total_attributes = 0;
|
2016-04-29 18:27:15 +03:00
|
|
|
bool is_setup = false;
|
2016-04-28 20:01:47 +03:00
|
|
|
};
|
|
|
|
|
2016-09-18 03:38:01 +03:00
|
|
|
} // namespace Pica
|