From 09dc8d645d68fedd941de487b6e108680dcf806d Mon Sep 17 00:00:00 2001 From: IlyaShurupov Date: Sat, 9 Nov 2024 00:36:42 +0300 Subject: [PATCH] populate command buffer --- .nvimlog | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ main.cpp | 67 +++++++++++++++++++ 2 files changed, 264 insertions(+) create mode 100644 .nvimlog diff --git a/.nvimlog b/.nvimlog new file mode 100644 index 0000000..c8becd9 --- /dev/null +++ b/.nvimlog @@ -0,0 +1,197 @@ +DBG 2024-11-09T00:47:19.479 ?.1044 process_spawn:126: new: pid=1046 exepath=[/usr/local/bin/nvim] +DBG 2024-11-09T00:47:19.479 ?.1044 rpc_start:97: rpc ch 3 in-stream=0x5fce9d505360 out-stream=0x5fce9d505500 +DBG 2024-11-09T00:47:19.479 ?.1044 tui_get_stty_erase:2509: stty/termios:erase= +DBG 2024-11-09T00:47:19.480 ?.1044 tui_tk_ti_getstr:2526: libtermkey:kbs= +DBG 2024-11-09T00:47:19.480 ?.1044 tui_tk_ti_getstr:2531: libtermkey:kdch1=[3~ +DBG 2024-11-09T00:47:19.480 ?.1044 tui_tk_ti_getstr:2537: libtermkey:kmous=[< +INF 2024-11-09T00:47:19.480 ?.1044 patch_terminfo_bugs:1998: Disabling smglr with TERM=xterm for non-xterm. +INF 2024-11-09T00:47:19.480 ?.1044 patch_terminfo_bugs:2002: Disabling smglp with TERM=xterm for non-xterm. +INF 2024-11-09T00:47:19.480 ?.1044 patch_terminfo_bugs:2006: Disabling smgrp with TERM=xterm for non-xterm. +DBG 2024-11-09T00:47:19.481 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_ui_attach +DBG 2024-11-09T00:47:19.481 ?.1046 rpc_start:97: rpc ch 1 in-stream=0x5dfbf5c90200 out-stream=0x5dfbf5c90060 +INF 2024-11-09T00:47:19.481 nvim.1046.0 set_init_2:595: startup runtimepath/packpath value: /home/auser/.config/nvim,/etc/xdg/nvim,/home/auser/.local/share/nvim/site,/home/auser/.local/share/flatpak/exports/share/nvim/site,/var/lib/flatpak/exports/share/nvim/site,/usr/local/share/nvim/site,/usr/share/nvim/site,/var/lib/snapd/desktop/nvim/site,/usr/local/share/nvim/runtime,/usr/local/lib/nvim,/var/lib/snapd/desktop/nvim/site/after,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,/var/lib/flatpak/exports/share/nvim/site/after,/home/auser/.local/share/flatpak/exports/share/nvim/site/after,/home/auser/.local/share/nvim/site/after,/etc/xdg/nvim/after,/home/auser/.config/nvim/after +DBG 2024-11-09T00:47:19.482 nvim.1046.0 receive_msgpack:256: ch 1: parsing 119 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:19.482 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_ui_attach +DBG 2024-11-09T00:47:19.482 nvim.1046.0 handle_request:388: RPC: scheduled nvim_ui_attach +DBG 2024-11-09T00:47:19.482 nvim.1046.0 handle_nvim_ui_attach:6116: RPC: ch 1: invoke nvim_ui_attach +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: option_set +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: option_set (+15 times...) +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: set_icon +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: set_title +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: chdir +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: option_set +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: option_set (+4 times...) +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: grid_resize +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: grid_clear +DBG 2024-11-09T00:47:19.482 nvim.1046.0 UI: update_menu +DBG 2024-11-09T00:47:19.483 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_ui_term_event +DBG 2024-11-09T00:47:19.484 nvim.1046.0 receive_msgpack:256: ch 1: parsing 60 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:19.484 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_ui_term_event +DBG 2024-11-09T00:47:19.484 nvim.1046.0 handle_request:388: RPC: scheduled nvim_ui_term_event +INF 2024-11-09T00:47:19.490 nvim.1046.0 emsg_multiline:718: E886: System error while opening ShaDa file /home/auser/.local/state/nvim/shada/main.shada for reading: permission denied +DBG 2024-11-09T00:47:19.490 nvim.1046.0 UI: update_menu (+10 times...) +DBG 2024-11-09T00:47:19.490 nvim.1046.0 UI: default_colors_set +DBG 2024-11-09T00:47:19.490 nvim.1046.0 UI: raw_line +INF 2024-11-09T00:47:19.490 nvim.1046.0 emsg_multiline:718: E303: Unable to create directory "/home/auser/.local/state/nvim/swap" for swap file, recovery impossible: permission denied +INF 2024-11-09T00:47:19.490 nvim.1046.0 emsg_multiline:718: E303: Unable to open swap file for "/home/auser/src/intern/sandbox/vulkan/.git/COMMIT_EDITMSG", recovery impossible +INF 2024-11-09T00:47:19.490 nvim.1046.0 emsg_multiline:718: E886: System error while opening ShaDa file /home/auser/.local/state/nvim/shada/main.shada for reading: permission denied +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: option_set +INF 2024-11-09T00:47:19.496 nvim.1046.0 main:661: starting main loop +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: grid_scroll +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: raw_line (+8 times...) +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:19.496 ?.1044 receive_msgpack:256: ch 3: parsing 3851 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: mode_info_set +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: mode_change +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: mouse_off +DBG 2024-11-09T00:47:19.496 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:19.496 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:19.496 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_ui_set_option +DBG 2024-11-09T00:47:19.496 nvim.1046.0 receive_msgpack:256: ch 1: parsing 27 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:19.496 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_ui_set_option +DBG 2024-11-09T00:47:19.496 nvim.1046.0 handle_request:388: RPC: scheduled nvim_ui_set_option +DBG 2024-11-09T00:47:19.496 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_ui_set_option +DBG 2024-11-09T00:47:19.496 nvim.1046.0 receive_msgpack:256: ch 1: parsing 27 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:19.496 ?.1044 receive_msgpack:256: ch 3: parsing 3265 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:19.496 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_ui_set_option +DBG 2024-11-09T00:47:19.496 nvim.1046.0 handle_request:388: RPC: scheduled nvim_ui_set_option +DBG 2024-11-09T00:47:19.594 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_ui_try_resize +DBG 2024-11-09T00:47:19.594 nvim.1046.0 receive_msgpack:256: ch 1: parsing 24 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:19.594 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_ui_try_resize +DBG 2024-11-09T00:47:23.498 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:28.787 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_input +DBG 2024-11-09T00:47:28.787 nvim.1046.0 receive_msgpack:256: ch 1: parsing 22 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:28.787 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_input +DBG 2024-11-09T00:47:28.787 nvim.1046.0 handle_nvim_input:6835: RPC: ch 1: invoke nvim_input +DBG 2024-11-09T00:47:28.787 nvim.1046.0 may_trigger_safestate:301: SafeState: Start triggering +DBG 2024-11-09T00:47:28.787 nvim.1046.0 UI: flush (+1 times...) +DBG 2024-11-09T00:47:28.787 nvim.1046.0 UI: hl_group_set +DBG 2024-11-09T00:47:28.788 nvim.1046.0 UI: hl_group_set (+61 times...) +DBG 2024-11-09T00:47:28.788 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:28.793 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: raw_line (+45 times...) +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: win_viewport +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: mouse_on +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:28.793 nvim.1046.0 state_enter:98: input: K_EVENT +DBG 2024-11-09T00:47:28.793 ?.1044 receive_msgpack:256: ch 3: parsing 2481 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:28.793 nvim.1046.0 handle_nvim_ui_term_event:6511: RPC: ch 1: invoke nvim_ui_term_event +DBG 2024-11-09T00:47:28.793 nvim.1046.0 handle_nvim_ui_set_option:6323: RPC: ch 1: invoke nvim_ui_set_option +DBG 2024-11-09T00:47:28.793 nvim.1046.0 handle_nvim_ui_set_option:6323: RPC: ch 1: invoke nvim_ui_set_option +DBG 2024-11-09T00:47:28.793 nvim.1046.0 handle_nvim_ui_try_resize:6281: RPC: ch 1: invoke nvim_ui_try_resize +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: option_set +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: option_set (+4 times...) +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: default_colors_set +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: grid_resize +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: grid_clear +DBG 2024-11-09T00:47:28.793 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: raw_line (+65 times...) +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: win_viewport +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:28.799 ?.1044 receive_msgpack:256: ch 3: parsing 2152 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:28.799 nvim.1046.0 may_trigger_safestate:301: SafeState: Start triggering +DBG 2024-11-09T00:47:28.799 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: mode_info_set +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: mode_change +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: mouse_on +DBG 2024-11-09T00:47:28.799 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:28.799 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=1 events_pending=0 +DBG 2024-11-09T00:47:28.799 ?.1044 receive_msgpack:256: ch 3: parsing 1849 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:29.932 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_input +DBG 2024-11-09T00:47:29.932 nvim.1046.0 receive_msgpack:256: ch 1: parsing 16 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:29.932 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_input +DBG 2024-11-09T00:47:29.932 nvim.1046.0 handle_nvim_input:6835: RPC: ch 1: invoke nvim_input +DBG 2024-11-09T00:47:29.932 nvim.1046.0 state_no_longer_safe:315: SafeState reset: key typed +DBG 2024-11-09T00:47:29.932 nvim.1046.0 state_enter:98: input: <:> +DBG 2024-11-09T00:47:29.932 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:29.933 ?.1044 receive_msgpack:256: ch 3: parsing 47 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:29.933 nvim.1046.0 may_trigger_safestate:301: SafeState: Start triggering +DBG 2024-11-09T00:47:29.933 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: raw_line (+1 times...) +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: mode_change +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: mouse_off +DBG 2024-11-09T00:47:29.933 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:29.933 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=1 events_pending=0 +DBG 2024-11-09T00:47:29.933 ?.1044 receive_msgpack:256: ch 3: parsing 130 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:31.203 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_input +DBG 2024-11-09T00:47:31.203 nvim.1046.0 receive_msgpack:256: ch 1: parsing 16 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:31.203 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_input +DBG 2024-11-09T00:47:31.203 nvim.1046.0 handle_nvim_input:6835: RPC: ch 1: invoke nvim_input +DBG 2024-11-09T00:47:31.203 nvim.1046.0 state_no_longer_safe:315: SafeState reset: key typed +DBG 2024-11-09T00:47:31.203 nvim.1046.0 state_enter:98: input: +DBG 2024-11-09T00:47:31.203 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:31.203 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.203 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.203 nvim.1046.0 may_trigger_safestate:301: SafeState: Start triggering +DBG 2024-11-09T00:47:31.203 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.203 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:31.203 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:31.203 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=1 events_pending=0 +DBG 2024-11-09T00:47:31.203 ?.1044 receive_msgpack:256: ch 3: parsing 71 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:31.248 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_input +DBG 2024-11-09T00:47:31.248 nvim.1046.0 receive_msgpack:256: ch 1: parsing 16 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:31.248 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_input +DBG 2024-11-09T00:47:31.248 nvim.1046.0 handle_nvim_input:6835: RPC: ch 1: invoke nvim_input +DBG 2024-11-09T00:47:31.248 nvim.1046.0 state_no_longer_safe:315: SafeState reset: key typed +DBG 2024-11-09T00:47:31.248 nvim.1046.0 state_enter:98: input: +DBG 2024-11-09T00:47:31.248 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:31.248 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.248 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.248 nvim.1046.0 may_trigger_safestate:301: SafeState: Start triggering +DBG 2024-11-09T00:47:31.248 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.248 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:31.248 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:31.248 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=1 events_pending=0 +DBG 2024-11-09T00:47:31.248 ?.1044 receive_msgpack:256: ch 3: parsing 71 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:31.830 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_input +DBG 2024-11-09T00:47:31.830 nvim.1046.0 receive_msgpack:256: ch 1: parsing 22 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:31.830 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_input +DBG 2024-11-09T00:47:31.830 nvim.1046.0 handle_nvim_input:6835: RPC: ch 1: invoke nvim_input +DBG 2024-11-09T00:47:31.830 nvim.1046.0 state_no_longer_safe:315: SafeState reset: key typed +DBG 2024-11-09T00:47:31.830 nvim.1046.0 state_enter:98: input: +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:31.830 ?.1044 receive_msgpack:256: ch 3: parsing 46 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: mode_change +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: mouse_on +DBG 2024-11-09T00:47:31.830 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:31.830 ?.1044 receive_msgpack:256: ch 3: parsing 167 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: raw_line +INF 2024-11-09T00:47:31.832 nvim.1046.0 emsg_multiline:718: E886: System error while opening ShaDa file /home/auser/.local/state/nvim/shada/main.shada for reading to merge before writing it: permission denied +INF 2024-11-09T00:47:31.832 nvim.1046.0 emsg_multiline:718: E886: Failed to create directory /home/auser/.local/state/nvim/shada for writing ShaDa file: permission denied +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: grid_scroll +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: raw_line +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: raw_line (+5 times...) +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: grid_cursor_goto +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: mouse_off +DBG 2024-11-09T00:47:31.832 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:31.832 nvim.1046.0 inbuf_poll:471: blocking... events_enabled=0 events_pending=0 +DBG 2024-11-09T00:47:31.832 ?.1044 receive_msgpack:256: ch 3: parsing 1148 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:32.806 ?.1044 log_notify:61: RPC -> 3: [notify] nvim_input +DBG 2024-11-09T00:47:32.806 nvim.1046.0 receive_msgpack:256: ch 1: parsing 22 bytes from msgpack Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:32.806 nvim.1046.0 log_notify:61: RPC <- 1: [notify] nvim_input +DBG 2024-11-09T00:47:32.806 nvim.1046.0 handle_nvim_input:6835: RPC: ch 1: invoke nvim_input +DBG 2024-11-09T00:47:32.806 nvim.1046.0 UI: flush (+1 times...) +DBG 2024-11-09T00:47:32.806 nvim.1046.0 UI: mouse_on +DBG 2024-11-09T00:47:32.806 nvim.1046.0 UI: flush +DBG 2024-11-09T00:47:32.806 nvim.1046.0 UI: stop +DBG 2024-11-09T00:47:32.806 ?.1044 receive_msgpack:256: ch 3: parsing 35 bytes from msgpack Stream: 0x5fce9d505500 +DBG 2024-11-09T00:47:32.806 nvim.1046.0 stream_close:106: closing Stream: 0x5dfbf5c90060 +DBG 2024-11-09T00:47:32.806 nvim.1046.0 stream_close:106: closing Stream: 0x5dfbf5c90200 +DBG 2024-11-09T00:47:32.806 ?.1044 read_cb:117: closing Stream (0x5fce9d505500): EOF (end of file) +DBG 2024-11-09T00:47:32.806 ?.1044 stream_close:106: closing Stream: 0x5fce9d505360 +DBG 2024-11-09T00:47:32.806 ?.1044 stream_close:106: closing Stream: 0x5fce9d505500 +INF 2024-11-09T00:47:32.806 ?.1044 chan_close_with_error:561: RPC: ch 3 was closed by the client +INF 2024-11-09T00:47:32.806 nvim.1046.0 os_exit:695: Nvim exit: 0 +INF 2024-11-09T00:47:32.807 ?.1044 on_process_exit:431: exited: pid=1046 status=0 stoptime=0 +DBG 2024-11-09T00:47:32.807 ?.1044 stream_close:106: closing Stream: 0x5fce9d526ca8 +INF 2024-11-09T00:47:32.807 ?.1044 os_exit:695: Nvim exit: 0 diff --git a/main.cpp b/main.cpp index 58c053b..e3e6e48 100644 --- a/main.cpp +++ b/main.cpp @@ -61,6 +61,7 @@ private: createSwapChainFramebuffers(); createCommandPool(); + createCommandBuffer(); } void mainLoop() { @@ -670,6 +671,71 @@ private: } } + void createCommandBuffer() { + VkCommandBufferAllocateInfo allocateInfo { + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, + .commandPool = mCommandPool, + .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY, + .commandBufferCount = 1, + }; + + if (vkAllocateCommandBuffers(mDevice, &allocateInfo, &mCommandBuffer) != VK_SUCCESS) { + throw std::runtime_error("failed to create command buffer"); + } + } + + void populateGraphicsCommandBuffer(VkCommandBuffer commandBuffer, uint32_t swapChainImageIndex) { + VkCommandBufferBeginInfo commandBufferBeginInfo { + .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, + }; + + if (vkBeginCommandBuffer(commandBuffer, &commandBufferBeginInfo) != VK_SUCCESS) { + throw std::runtime_error("failed to begin command buffer ="); + } + + VkClearValue clearColor{.color = {.float32 = {0.f, 0.f, 0.f, 1.f}}}; + + VkRenderPassBeginInfo renderPassBeginInfo { + .sType = VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO, + .renderPass = mGraphicsRenderPass, + .framebuffer = mSwapChainFrameBuffers[swapChainImageIndex], + .renderArea = { + .offset = { 0, 0 }, + .extent = mSwapChainExtent, + }, + .clearValueCount = 1, + .pClearValues = &clearColor, + }; + + vkCmdBeginRenderPass(commandBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE); + vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, mGraphicsPipeline); + + VkViewport viewport { + .x = 0, + .y = 0, + .width = (float) mSwapChainExtent.width, + .height = (float) mSwapChainExtent.height, + .minDepth = 0.f, + .maxDepth = 1.f, + }; + + VkRect2D scissor { + .offset = { 0, 0 }, + .extent = mSwapChainExtent, + }; + + vkCmdSetViewport(commandBuffer, 0, 1, &viewport); + vkCmdSetScissor(commandBuffer, 0, 1, &scissor); + + vkCmdDraw(commandBuffer, 3, 1, 0, 0); + + vkCmdEndRenderPass(commandBuffer); + + if (vkEndCommandBuffer(commandBuffer) != VK_SUCCESS) { + throw std::runtime_error("failed to end command buffer"); + } + } + void destroyCommandPool() { vkDestroyCommandPool(mDevice, mCommandPool, nullptr); } @@ -720,6 +786,7 @@ private: VkPipelineLayout mGraphicsPipelineLayout {}; // no uniforms used in the shader VkCommandPool mCommandPool = VK_NULL_HANDLE; + VkCommandBuffer mCommandBuffer = VK_NULL_HANDLE; }; int main() {