set(vertex_setup, s, VERTEX_SETUP);
}
+void PipelineState::set_primitive_type(PrimitiveType t)
+{
+ set(primitive_type, t, PRIMITIVE_TYPE);
+}
+
void PipelineState::set_front_face(FaceWinding w)
{
set(front_face, w, FACE_CULL);
#include <msp/core/noncopyable.h>
#include "cullface.h"
#include "pipelinestate_backend.h"
+#include "primitivetype.h"
namespace Msp {
namespace GL {
FACE_CULL = 128,
DEPTH_TEST = 256,
STENCIL_TEST = 512,
- BLEND = 1024
+ BLEND = 1024,
+ PRIMITIVE_TYPE = 2048
};
const Framebuffer *framebuffer = 0;
std::vector<BoundUniformBlock> uniform_blocks;
std::vector<BoundTexture> textures;
const VertexSetup *vertex_setup = 0;
+ PrimitiveType primitive_type = TRIANGLES;
FaceWinding front_face = COUNTERCLOCKWISE;
CullMode face_cull = NO_CULL;
const DepthTest *depth_test = 0;
void set_uniform_block(int, const UniformBlock *);
void set_texture(unsigned, const Texture *, const Sampler *);
void set_vertex_setup(const VertexSetup *);
+ void set_primitive_type(PrimitiveType);
void set_front_face(FaceWinding);
void set_face_cull(CullMode);
void set_depth_test(const DepthTest *);
{
apply_state();
batch.refresh();
+ pipeline_state.set_primitive_type(batch.get_type());
commands.use_pipeline(&pipeline_state);
commands.draw(batch);
}
{
apply_state();
batch.refresh();
+ pipeline_state.set_primitive_type(batch.get_type());
commands.use_pipeline(&pipeline_state);
commands.draw_instanced(batch, count);
}