diff --git a/code/font/vefontcache/LICENSE.md b/code/font/vefontcache/LICENSE.md index 5652bec..6e7af2f 100644 --- a/code/font/vefontcache/LICENSE.md +++ b/code/font/vefontcache/LICENSE.md @@ -1,4 +1,4 @@ -VEFontCache Odin +VEFontCache Odin Copyright 2024 Edward R. Gonzalez This project is based on Vertex Engine GPU Font Cache diff --git a/code/font/vefontcache/draw.odin b/code/font/vefontcache/draw.odin index 9f07f2a..d8225e7 100644 --- a/code/font/vefontcache/draw.odin +++ b/code/font/vefontcache/draw.odin @@ -464,7 +464,7 @@ generate_shape_draw_list :: proc( draw_list : ^Draw_List, shape : Shaped_Text, * Oversized will have a draw call setup to blit directly from the glyph buffer to the target. * to_cache will blit the glyphs rendered from the buffer to the atlas. */ -@(optimization_mode = "favor_size") +@(optimization_mode="favor_size") batch_generate_glyphs_draw_list :: proc ( draw_list : ^Draw_List, shape : Shaped_Text, glyph_pack : ^#soa[dynamic]Glyph_Pack_Entry, @@ -641,7 +641,7 @@ batch_generate_glyphs_draw_list :: proc ( draw_list : ^Draw_List, } profile_end() - @(optimization_mode = "favor_size") + @(optimization_mode="favor_size") generate_blit_from_atlas_draw_list :: #force_inline proc (draw_list : ^Draw_List, glyph_pack : #soa[]Glyph_Pack_Entry, sub_pack : []i32, colour : RGBAN ) { profile(#procedure) diff --git a/code/font/vefontcache/vefontcache.odin b/code/font/vefontcache/vefontcache.odin index 15ea220..5abc9fc 100644 --- a/code/font/vefontcache/vefontcache.odin +++ b/code/font/vefontcache/vefontcache.odin @@ -757,7 +757,7 @@ draw_shape_normalized_space :: #force_inline proc( ctx : ^Context, • position: Anchor point in normalized space (where the bottom-right vertex of the first glyph quad will be positioned) <-> scale : Scale the glyph beyond its default scaling from its px_size. */ -@(optimization_mode = "favor_size") +@(optimization_mode="favor_size") draw_text_normalized_space :: proc( ctx : ^Context, font : Font_ID, px_size : f32, diff --git a/code/sectr/font/render_sokol.odin b/code/sectr/font/render_sokol.odin index 88fd8eb..7b80823 100644 --- a/code/sectr/font/render_sokol.odin +++ b/code/sectr/font/render_sokol.odin @@ -42,11 +42,10 @@ font_provider_setup_sokol_gfx_objects :: proc( ctx : ^VE_RenderData, ve_ctx : ve BlendState :: sokol_gfx.Blend_State BorderColor :: sokol_gfx.Border_Color BufferDesciption :: sokol_gfx.Buffer_Desc - BufferUsage :: sokol_gfx.Usage - BufferType :: sokol_gfx.Buffer_Type ColorTargetState :: sokol_gfx.Color_Target_State Filter :: sokol_gfx.Filter ImageDesc :: sokol_gfx.Image_Desc + ImageUsage :: sokol_gfx.Image_Usage PassAction :: sokol_gfx.Pass_Action Range :: sokol_gfx.Range ResourceState :: sokol_gfx.Resource_State @@ -68,15 +67,13 @@ font_provider_setup_sokol_gfx_objects :: proc( ctx : ^VE_RenderData, ve_ctx : ve draw_list_vbuf = sokol_gfx.make_buffer( BufferDesciption { size = size_of([4]f32) * 4 * Mega, - usage = BufferUsage.STREAM, - type = BufferType.VERTEXBUFFER, + usage = {vertex_buffer = true, stream_update = true}, }) verify( sokol_gfx.query_buffer_state( draw_list_vbuf) < ResourceState.FAILED, "Failed to make draw_list_vbuf" ) draw_list_ibuf = sokol_gfx.make_buffer( BufferDesciption { size = size_of(u32) * 6 * Mega, - usage = BufferUsage.STREAM, - type = BufferType.INDEXBUFFER, + usage = {index_buffer = true, stream_update = true}, }) verify( sokol_gfx.query_buffer_state( draw_list_ibuf) < ResourceState.FAILED, "Failed to make draw_list_iubuf" ) @@ -141,12 +138,11 @@ font_provider_setup_sokol_gfx_objects :: proc( ctx : ^VE_RenderData, ve_ctx : ve { glyph_rt_color = sokol_gfx.make_image( ImageDesc { type = ._2D, - render_target = true, + usage = ImageUsage { render_attachment = true, immutable = true }, width = i32(ve_ctx.glyph_buffer.size.x), height = i32(ve_ctx.glyph_buffer.size.y), num_slices = 1, num_mipmaps = 1, - usage = .IMMUTABLE, pixel_format = .R8, sample_count = 1, // TODO(Ed): Setup labels for debug tracing/logging @@ -156,12 +152,11 @@ font_provider_setup_sokol_gfx_objects :: proc( ctx : ^VE_RenderData, ve_ctx : ve glyph_rt_depth = sokol_gfx.make_image( ImageDesc { type = ._2D, - render_target = true, + usage = ImageUsage { render_attachment = true, immutable = true }, width = i32(ve_ctx.glyph_buffer.size.x), height = i32(ve_ctx.glyph_buffer.size.y), num_slices = 1, num_mipmaps = 1, - usage = .IMMUTABLE, pixel_format = .DEPTH, sample_count = 1, }) @@ -278,12 +273,11 @@ font_provider_setup_sokol_gfx_objects :: proc( ctx : ^VE_RenderData, ve_ctx : ve { atlas_rt_color = sokol_gfx.make_image( ImageDesc { type = ._2D, - render_target = true, + usage = { render_attachment = true, immutable = true }, width = i32(ve_ctx.atlas.size.x), height = i32(ve_ctx.atlas.size.y), num_slices = 1, num_mipmaps = 1, - usage = .IMMUTABLE, pixel_format = .R8, sample_count = 1, // TODO(Ed): Setup labels for debug tracing/logging @@ -293,12 +287,11 @@ font_provider_setup_sokol_gfx_objects :: proc( ctx : ^VE_RenderData, ve_ctx : ve atlas_rt_depth = sokol_gfx.make_image( ImageDesc { type = ._2D, - render_target = true, + usage = { render_attachment = true, immutable = true }, width = i32(ve_ctx.atlas.size.x), height = i32(ve_ctx.atlas.size.y), num_slices = 1, num_mipmaps = 1, - usage = .IMMUTABLE, pixel_format = .DEPTH, sample_count = 1, }) diff --git a/scripts/compile_shaders.ps1 b/scripts/compile_shaders.ps1 index 12d23bf..c0aa848 100644 --- a/scripts/compile_shaders.ps1 +++ b/scripts/compile_shaders.ps1 @@ -32,6 +32,7 @@ $flag_format_odin = '--format=sokol_odin' $flag_module = '--module' push-location $path_shaders +write-host 'Compiling shaders' & $sokol_shdc --input $shadersrc_ve_blit_atlas --output $shaderout_ve_blit_atlas --slang 'hlsl4' $flag_format_odin $flag_module='vefc_blit_atlas' & $sokol_shdc --input $shadersrc_ve_render_glyph --output $shaderout_ve_render_glyph --slang 'hlsl4' $flag_format_odin $flag_module='vefc_render_glyph' & $sokol_shdc --input $shadersrc_ve_draw_text --output $shaderout_ve_draw_text --slang 'hlsl4' $flag_format_odin $flag_module='vefc_draw_text' diff --git a/scripts/update_deps.ps1 b/scripts/update_deps.ps1 index 985e623..25a00cf 100644 --- a/scripts/update_deps.ps1 +++ b/scripts/update_deps.ps1 @@ -7,7 +7,6 @@ $path_thirdparty = join-path $path_root 'thirdparty' $path_toolchain = join-path $path_root 'toolchain' $url_backtrace_repo = 'https://github.com/Ed94/back.git' -$url_freetype = 'https://github.com/Ed94/odin-freetype.git' $url_harfbuzz = 'https://github.com/Ed94/harfbuzz-odin.git' $url_ini_parser = 'https://github.com/laytan/odin-ini-parser.git' $url_odin_repo = 'https://github.com/Ed94/Odin.git' @@ -15,7 +14,6 @@ $url_sokol = 'https://github.com/Ed94/sokol-odin.git' $url_sokol_tools = 'https://github.com/floooh/sokol-tools-bin.git' $path_backtrace = join-path $path_thirdparty 'backtrace' -$path_freetype = join-path $path_thirdparty 'freetype' $path_harfbuzz = join-path $path_thirdparty 'harfbuzz' $path_ini_parser = join-path $path_thirdparty 'ini' $path_odin = join-path $path_toolchain 'Odin' @@ -35,7 +33,6 @@ $result = verify-path $path_toolchain $binaries_dirty = $false clone-gitrepo $path_backtrace $url_backtrace_repo -clone-gitrepo $path_freetype $url_freetype clone-gitrepo $path_ini_parser $url_ini_parser clone-gitrepo $path_ini_parser $url_ini_parser clone-gitrepo $path_sokol_tools $url_sokol_tools @@ -46,7 +43,6 @@ Update-GitRepo -path $path_harfbuzz -url $url_harfbuzz -build_command '.\script $path_vendor = join-path $path_odin 'vendor' $path_vendor_raylib = join-path $path_vendor 'raylib' -$path_freetype_dlls = join-path $path_freetype 'binaries/release' $path_harfbuzz_dlls = join-path $path_harfbuzz 'lib/win64' $path_raylib_dlls = join-path $path_vendor_raylib 'windows' $path_sokol_dlls = join-path $path_thirdparty 'sokol' diff --git a/sectr.proj b/sectr.proj new file mode 100644 index 0000000..a3940ec --- /dev/null +++ b/sectr.proj @@ -0,0 +1,9 @@ +// raddbg 0.9.18 project file + +recent_file: path: "code/host/host.odin" +target: +{ + executable: "build/sectr_host.exe" + working_directory: build + enabled: 1 +} diff --git a/sectr.user b/sectr.user new file mode 100644 index 0000000..c494749 --- /dev/null +++ b/sectr.user @@ -0,0 +1,150 @@ +// raddbg 0.9.18 user file + +recent_project: path: "sectr.proj" +window: +{ + size: 2048.000000 1152.000000 + pos: 182 182 + monitor: "\\\\.\\DISPLAY1" + maximized + panels: + { + 0.731895: getting_started text: + { + selected + expression: "file:\"C:/projects/sectrprototype/code/host/host.odin\".data" + auto: 1 + query: input: "" + cursor_line: 222 + cursor_column: 23 + mark_line: 222 + mark_column: 23 + } + 0.268105: + { + selected + watch: expression: "" + watch: selected expression: "query:targets" + } + } +} +keybindings: +{ + { kill_all f5 shift } + { step_into_inst f11 alt } + { step_over_inst f10 alt } + { step_out f11 shift } + { halt x ctrl shift } + { halt pause } + { run f5 } + { restart f5 ctrl shift } + { step_into f11 } + { step_over f10 } + { run_to_line f10 ctrl } + { set_next_statement f10 ctrl shift } + { inc_window_font_size equal alt } + { dec_window_font_size minus alt } + { window n ctrl shift } + { toggle_fullscreen return ctrl } + { new_panel_right p ctrl } + { new_panel_down minus ctrl } + { rotate_panel_columns 2 ctrl } + { next_panel comma ctrl } + { prev_panel comma ctrl shift } + { focus_panel_right right ctrl alt } + { focus_panel_left left ctrl alt } + { focus_panel_up up ctrl alt } + { focus_panel_down down ctrl alt } + { undo z ctrl } + { redo y ctrl } + { go_back left alt } + { go_forward right alt } + { close_panel p ctrl shift alt } + { next_tab page_down ctrl } + { prev_tab page_up ctrl } + { next_tab tab ctrl } + { prev_tab tab ctrl shift } + { move_tab_right page_down ctrl shift } + { move_tab_left page_up ctrl shift } + { close_tab w ctrl } + { tab_bar_top up ctrl shift alt } + { tab_bar_bottom down ctrl shift alt } + { open_tab t ctrl } + { open o ctrl } + { switch i ctrl } + { switch_to_partner_file o alt } + { open_user n ctrl shift alt } + { open_project n ctrl alt } + { open_user o ctrl shift alt } + { open_project o ctrl alt } + { save_user s ctrl shift alt } + { save_project s ctrl shift } + { edit f2 } + { accept return } + { accept space } + { cancel esc } + { move_left left } + { move_right right } + { move_up up } + { move_down down } + { move_left_select left shift } + { move_right_select right shift } + { move_up_select up shift } + { move_down_select down shift } + { move_left_chunk left ctrl } + { move_right_chunk right ctrl } + { move_up_chunk up ctrl } + { move_down_chunk down ctrl } + { move_up_page page_up } + { move_down_page page_down } + { move_up_whole home ctrl } + { move_down_whole end ctrl } + { move_left_chunk_select left ctrl shift } + { move_right_chunk_select right ctrl shift } + { move_up_chunk_select up ctrl shift } + { move_down_chunk_select down ctrl shift } + { move_up_page_select page_up shift } + { move_down_page_select page_down shift } + { move_up_whole_select home ctrl shift } + { move_down_whole_select end ctrl shift } + { move_up_reorder up alt } + { move_down_reorder down alt } + { move_home home } + { move_end end } + { move_home_select home shift } + { move_end_select end shift } + { select_all a ctrl } + { delete_single delete } + { delete_chunk delete ctrl } + { backspace_single backspace } + { backspace_chunk backspace ctrl } + { copy c ctrl } + { copy insert ctrl } + { cut x ctrl } + { paste v ctrl } + { paste insert shift } + { insert_text null } + { move_next tab } + { move_prev tab shift } + { goto_line g ctrl } + { goto_address g alt } + { search f ctrl } + { search_backwards r ctrl } + { find_next f3 } + { find_prev f3 ctrl } + { find_selected_thread f4 } + { goto_name j ctrl } + { goto_name_at_cursor f12 } + { toggle_watch_expr_at_cursor w alt } + { toggle_watch_expr_at_mouse d ctrl } + { toggle_watch_pin f9 ctrl } + { toggle_breakpoint f9 } + { add_address_breakpoint f9 shift } + { add_function_breakpoint f9 ctrl shift } + { attach f6 shift } + { open_palette f1 } + { open_palette p ctrl shift } + { log_marker m ctrl shift alt } + { toggle_dev_menu d ctrl shift alt } +} +current_path: "C:/projects/SectrPrototype/build" diff --git a/thirdparty/stb/lib/stb_truetype.lib b/thirdparty/stb/lib/stb_truetype.lib index dd9c936..4f2adcf 100644 Binary files a/thirdparty/stb/lib/stb_truetype.lib and b/thirdparty/stb/lib/stb_truetype.lib differ