pipeline_state(0)
{ }
-void Commands::use_pipeline(const PipelineState &ps)
+void Commands::use_pipeline(const PipelineState *ps)
{
- pipeline_state = &ps;
+ pipeline_state = ps;
+ if(!pipeline_state)
+ PipelineState::clear();
}
void Commands::clear(const ClearValue *values)
public:
Commands();
- void use_pipeline(const PipelineState &);
+ void use_pipeline(const PipelineState *);
void clear(const ClearValue *);
void draw(const Batch &);
void draw_instanced(const Batch &, unsigned);
shdata_stack.reserve(32);
state = &state_stack.back();
add_shader_data(standard_shdata);
- commands.use_pipeline(pipeline_state);
}
Renderer::~Renderer()
add_shader_data(standard_shdata);
excluded.clear();
- PipelineState::clear();
+ commands.use_pipeline(0);
}
void Renderer::exclude(const Renderable &renderable)
void Renderer::clear(const ClearValue *values)
{
pipeline_state.set_framebuffer(state->framebuffer);
+ commands.use_pipeline(&pipeline_state);
commands.clear(values);
}
{
apply_state();
batch.refresh();
+ commands.use_pipeline(&pipeline_state);
commands.draw(batch);
}
{
apply_state();
batch.refresh();
+ commands.use_pipeline(&pipeline_state);
commands.draw_instanced(batch, count);
}
throw incompatible_data("Renderer::resolve_multisample");
pipeline_state.set_framebuffer(state->framebuffer);
+ commands.use_pipeline(&pipeline_state);
commands.resolve_multisample(target, buffers);
}