primitive_assembly: Add getters for internal state

This commit is contained in:
MerryMage 2017-12-27 13:02:34 +00:00 committed by wwylele
parent 06815ec905
commit 15d14be3cc
2 changed files with 20 additions and 0 deletions

View file

@ -71,6 +71,16 @@ void PrimitiveAssembler<VertexType>::Reconfigure(PipelineRegs::TriangleTopology
this->topology = topology; this->topology = topology;
} }
template <typename VertexType>
bool PrimitiveAssembler<VertexType>::IsEmpty() const {
return buffer_index == 0 && strip_ready == false;
}
template <typename VertexType>
PipelineRegs::TriangleTopology PrimitiveAssembler<VertexType>::GetTopology() const {
return topology;
}
// explicitly instantiate use cases // explicitly instantiate use cases
template struct PrimitiveAssembler<Shader::OutputVertex>; template struct PrimitiveAssembler<Shader::OutputVertex>;

View file

@ -45,6 +45,16 @@ struct PrimitiveAssembler {
*/ */
void Reconfigure(PipelineRegs::TriangleTopology topology); void Reconfigure(PipelineRegs::TriangleTopology topology);
/**
* Is our internal state empty?
*/
bool IsEmpty() const;
/**
* What is our triangle topology?
*/
PipelineRegs::TriangleTopology GetTopology() const;
private: private:
PipelineRegs::TriangleTopology topology; PipelineRegs::TriangleTopology topology;