#include "sdf_text_pipeline.h"

#include "core/renderer/renderer.h"

bool sdf_text_pipeline::init() {
    param_buffer = aorii::get_renderer_raw()->create_buffer(buffer_type::constant, sizeof(param), 1);
    sdf_font_param_buffer = aorii::get_renderer_raw()->create_buffer(buffer_type::constant, sizeof(sdf_font_param), 1);
    return pipeline::init();
}
void sdf_text_pipeline::destroy() {
    pipeline::destroy();
    aorii::get_renderer_raw()->destroy_buffer(param_buffer);
    aorii::get_renderer_raw()->destroy_buffer(sdf_font_param_buffer);
}

void sdf_text_pipeline::set_param(const param& in_param) {
    param_buffer->set_data(in_param);
}

void sdf_text_pipeline::set_sdf_font_param(const sdf_font_param& in_param) {
    sdf_font_param_buffer->set_data(in_param);
}
