]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/renderer.cpp
Check the flat qualifier from the correct member
[libs/gl.git] / source / render / renderer.cpp
index aab37b6796bece1dc7d2b58e1018fc51f1666a78..7e010b3f917b0a22a34d5bf1de66a7408e29259e 100644 (file)
@@ -71,7 +71,7 @@ void Renderer::push_state()
 
 void Renderer::pop_state()
 {
-       if(state_stack.size()==1)
+       if(state_stack.size()<=1)
                throw stack_underflow("Renderer::pop_state");
 
        uintptr_t old_pipeline = current_state->pipeline_key;
@@ -295,6 +295,8 @@ void Renderer::apply_batch(const Batch &batch)
        batch.refresh(frame_index);
        PipelineState &ps = get_pipeline_state();
        ps.set_primitive_type(batch.get_type());
+       if(batch.get_type()==PATCHES)
+               ps.set_patch_size(batch.get_patch_size());
        commands.use_pipeline(&ps);
 }