#include <gear/graphics/pipeline.h>

sg_pipeline g_pipeline_create(sg_shader shader, sg_vertex_layout_state layout) {
    return sg_make_pipeline(&(sg_pipeline_desc){
        .shader = shader,
        .layout = layout,
        .index_type = SG_INDEXTYPE_UINT32,
        .cull_mode = SG_CULLMODE_BACK,
        .depth = {
            .compare = SG_COMPAREFUNC_LESS_EQUAL,
            .write_enabled = true,
        },
    });
}

void g_pipeline_bind(g_renderer* renderer, sg_pipeline pipeline) {
    sg_apply_pipeline(pipeline);
    renderer->bound_pipeline_id = pipeline.id;
}
