remvoing ve_ prefix from glsl and generated odin code, not necessary to have

This commit is contained in:
2025-02-13 16:13:29 -05:00
parent d806fc6083
commit 1ed9d48a71
7 changed files with 1294 additions and 1320 deletions

View File

@@ -59,9 +59,9 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
backend := gfx.query_backend()
app_env := glue.environment()
ctx.glyph_shader = gfx.make_shader(ve_render_glyph_shader_desc(backend) )
ctx.atlas_shader = gfx.make_shader(ve_blit_atlas_shader_desc(backend) )
ctx.screen_shader = gfx.make_shader(ve_draw_text_shader_desc(backend) )
ctx.glyph_shader = gfx.make_shader(render_glyph_shader_desc(backend) )
ctx.atlas_shader = gfx.make_shader(blit_atlas_shader_desc(backend) )
ctx.screen_shader = gfx.make_shader(draw_text_shader_desc(backend) )
ctx.draw_list_vbuf = gfx.make_buffer( Buffer_Desciption {
size = cast(uint)(size_of([4]f32) * vert_cap),
@@ -83,12 +83,12 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
{
vs_layout : Vertex_Layout_State
{
vs_layout.attrs[ATTR_ve_render_glyph_v_position] = Vertex_Attribute_State {
vs_layout.attrs[ATTR_render_glyph_v_position] = Vertex_Attribute_State {
format = Vertex_Format.FLOAT2,
offset = 0,
buffer_index = 0,
}
vs_layout.attrs[ATTR_ve_render_glyph_v_texture] = Vertex_Attribute_State {
vs_layout.attrs[ATTR_render_glyph_v_texture] = Vertex_Attribute_State {
format = Vertex_Format.FLOAT2,
offset = size_of(ve.Vec2),
buffer_index = 0,
@@ -218,12 +218,12 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
{
vs_layout : Vertex_Layout_State
{
vs_layout.attrs[ATTR_ve_blit_atlas_v_position] = Vertex_Attribute_State {
vs_layout.attrs[ATTR_blit_atlas_v_position] = Vertex_Attribute_State {
format = Vertex_Format.FLOAT2,
offset = 0,
buffer_index = 0,
}
vs_layout.attrs[ATTR_ve_blit_atlas_v_texture] = Vertex_Attribute_State {
vs_layout.attrs[ATTR_blit_atlas_v_texture] = Vertex_Attribute_State {
format = Vertex_Format.FLOAT2,
offset = size_of(ve.Vec2),
buffer_index = 0,
@@ -354,12 +354,12 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
{
vs_layout : Vertex_Layout_State
{
vs_layout.attrs[ATTR_ve_draw_text_v_position] = Vertex_Attribute_State {
vs_layout.attrs[ATTR_draw_text_v_position] = Vertex_Attribute_State {
format = Vertex_Format.FLOAT2,
offset = 0,
buffer_index = 0,
}
vs_layout.attrs[ATTR_ve_draw_text_v_texture] = Vertex_Attribute_State {
vs_layout.attrs[ATTR_draw_text_v_texture] = Vertex_Attribute_State {
format = Vertex_Format.FLOAT2,
offset = size_of(ve.Vec2),
buffer_index = 0,
@@ -528,12 +528,12 @@ render_text_layer :: proc( screen_extent : ve.Vec2, ve_ctx : ^ve.Context, ctx :
gfx.apply_pipeline( ctx.atlas_pipeline )
fs_uniform := Ve_Blit_Atlas_Fs_Params {
fs_uniform := Blit_Atlas_Fs_Params {
glyph_buffer_size = ve.vec2(ve_ctx.glyph_buffer.size),
over_sample = ve_ctx.glyph_buffer.over_sample.x,
region = cast(i32) draw_call.region,
}
gfx.apply_uniforms( UB_ve_blit_atlas_fs_params, Range { & fs_uniform, size_of(Ve_Blit_Atlas_Fs_Params) })
gfx.apply_uniforms( UB_blit_atlas_fs_params, Range { & fs_uniform, size_of(Blit_Atlas_Fs_Params) })
gfx.apply_bindings(Bindings {
vertex_buffers = {
@@ -544,8 +544,8 @@ render_text_layer :: proc( screen_extent : ve.Vec2, ve_ctx : ^ve.Context, ctx :
},
index_buffer = ctx.draw_list_ibuf,
index_buffer_offset = 0,
images = { IMG_ve_blit_atlas_src_texture = ctx.glyph_rt_color, },
samplers = { SMP_ve_blit_atlas_src_sampler = ctx.glyph_rt_sampler, },
images = { IMG_blit_atlas_src_texture = ctx.glyph_rt_color, },
samplers = { SMP_blit_atlas_src_sampler = ctx.glyph_rt_sampler, },
})
// 3. Use the atlas (.Target) or the glyph buffer (.Target_Unchached) to then render the text.
@@ -568,7 +568,7 @@ render_text_layer :: proc( screen_extent : ve.Vec2, ve_ctx : ^ve.Context, ctx :
src_rt := ctx.atlas_rt_color
src_sampler := ctx.atlas_rt_sampler
fs_target_uniform := Ve_Draw_Text_Fs_Params {
fs_target_uniform := Draw_Text_Fs_Params {
// glyph_buffer_size = glyph_buf_size,
over_sample = ve_ctx.glyph_buffer.over_sample.x,
colour = draw_call.colour,
@@ -579,7 +579,7 @@ render_text_layer :: proc( screen_extent : ve.Vec2, ve_ctx : ^ve.Context, ctx :
src_rt = ctx.glyph_rt_color
src_sampler = ctx.glyph_rt_sampler
}
gfx.apply_uniforms( UB_ve_draw_text_fs_params, Range { & fs_target_uniform, size_of(Ve_Draw_Text_Fs_Params) })
gfx.apply_uniforms( UB_draw_text_fs_params, Range { & fs_target_uniform, size_of(Draw_Text_Fs_Params) })
gfx.apply_bindings(Bindings {
vertex_buffers = {
@@ -590,8 +590,8 @@ render_text_layer :: proc( screen_extent : ve.Vec2, ve_ctx : ^ve.Context, ctx :
},
index_buffer = ctx.draw_list_ibuf,
index_buffer_offset = 0,
images = { IMG_ve_draw_text_src_texture = src_rt, },
samplers = { SMP_ve_draw_text_src_sampler = src_sampler, },
images = { IMG_draw_text_src_texture = src_rt, },
samplers = { SMP_draw_text_src_sampler = src_sampler, },
})
}