diff --git a/.obsidian/core-plugins-migration.json b/.obsidian/core-plugins-migration.json index 5c13490..1d8661f 100644 --- a/.obsidian/core-plugins-migration.json +++ b/.obsidian/core-plugins-migration.json @@ -25,5 +25,6 @@ "workspaces": false, "file-recovery": true, "publish": false, - "sync": false + "sync": false, + "properties": true } \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json index 9405bfd..56b44a5 100644 --- a/.obsidian/core-plugins.json +++ b/.obsidian/core-plugins.json @@ -7,6 +7,7 @@ "canvas", "outgoing-link", "tag-pane", + "properties", "page-preview", "daily-notes", "templates", diff --git a/Assert/Image/image-20231221094249151.png b/Assert/Image/image-20231221094249151.png new file mode 100644 index 0000000..87ccd7d Binary files /dev/null and b/Assert/Image/image-20231221094249151.png differ diff --git a/note/learn/file/COFF.md b/note/learn/file/COFF.md deleted file mode 100644 index 71027fc..0000000 --- a/note/learn/file/COFF.md +++ /dev/null @@ -1,61 +0,0 @@ -# Linux - -```C++ -enum ENUM_ELFCLASS{ - ELFCLASSNONE = 0, - ELFCLASS32, - ELFCLASS64 -};//数值约束 -enum ENUM_DATADIR{ - ELFDATANONE = 0, - ELFDATALSB, - ELFDATAMSB -};//数值约束 -T16 ELF_Ident{ - T4 name "ELF\0";//字符约束 - T1 elf enum ENUM_ELFCLASS; - T1 dir enum ENUM_DATADIR; - ...; -}; -T64 Elf64_Ehdr{ - ELF_Ident e_ident; - T2 e_type; - T2 e_machine; - T4 e_version; - T8 e_entry; - T8 e_phoff; - T8 e_shoff; - T4 e_flags; - T2 e_ehsize; - T2 e_phentsize; - T2 e_phnum; - T2 e_shentsize; - T2 e_shnum; - T2 e_shstrndx; -}; -T64 Elf64_Shdr{ - T4 sh_name; - T4 sh_type; - T8 sh_flags; - T8 sh_addr; - T8 sh_offset; - T8 sh_size; - T4 sh_link; - T4 sh_info; - T8 sh_addralign; - T8 sh_entsize; -}; -void parse(Archive ar){ - ar >> ELF_Ident ident >> 0; - ident.elf ENUM_ELFCLASS{ - ELFCLASS32: ar >> Elf32_Ehdr hdr; - ELFCLASS64: ar >> Elf64_Ehdr hdr; - } - ar >> hdr.e_shoff >> Elf64_Shdr[hdr.e_shnum] sh_list; - { - section = sh_list >> hdr.e_shstrndx; - ar >> section.sh_offset >> - } -} -``` - diff --git a/note/learn/learn.md b/note/learn/learn.md index f981c7f..36a1250 100644 --- a/note/learn/learn.md +++ b/note/learn/learn.md @@ -15,10 +15,10 @@ [[ChatGPT]] ## File -[[COFF]] +[[coff]] ## Language -[[GoLang]] +[[note/code/lang/GoLang]] [[note/code/lang/Node]] [[PHP]] ### C++ @@ -35,10 +35,10 @@ [[数据规范]] [[数据类型]] [[数据事件]] -[[序列化]] +[[note/code/lang/zero/序列化]] ## tool -[[src/anki/anki]] +[[src/a/anki/anki]] [[obsidian]] ## theory [[编译]] diff --git a/note/learn/math/矩阵变换.md b/note/learn/math/矩阵变换.md index be4c2c7..8816b7c 100644 --- a/note/learn/math/矩阵变换.md +++ b/note/learn/math/矩阵变换.md @@ -65,6 +65,10 @@ P = P \cdot\ R = P \cdot\ R_x \cdot\ R_z \cdot\ R_y = \right\} $$ +### 任意轴 + +![image-20231221094249151](F:\ouczbs\znotes\Assert\Image\image-20231221094249151.png) + ### 四元素 $$ diff --git a/src/anki/anki.md b/src/a/anki/anki.md similarity index 100% rename from src/anki/anki.md rename to src/a/anki/anki.md diff --git a/src/c/c++/coroutine.md b/src/c/c++/coroutine.md new file mode 100644 index 0000000..ca0387e --- /dev/null +++ b/src/c/c++/coroutine.md @@ -0,0 +1,45 @@ +--- +aliases: +tags: +creation date: 2024-01-26 09:55 +modification date: 星期五 26日 一月 2024 09:55:11 +--- +# 协程原理 +协程是可暂停和恢复的函数 +## 暂停 +- 什么时候暂停? + - IO查询,陷入IO事件时 + - yield 接口,主动调用 +- 被动暂停 协程框架隐藏相关细节 + - IO 暂停 +- 主动暂停 手动显示调用 + - yield + - chanel + +## 恢复 +- 什么时候恢复? + - IO多路复用,调度器恢复 + - 代码接口,主动调用 +- 怎么恢复? + - 无栈协程 + - 编译器生成拓展汇编代码 + - 保存函数状态 + - 确定暂停点状态切换 + - 有栈协程 + - 分配函数栈,类似线程 +- 主动恢复 + - 代码显示控制 + - 恢复父协程 + - 非对称协程 + - 来自调度器调度 + - 恢复任意协程 + - 对称协程 + - 绕过调度器 +- 被动恢复 + - IO多路复用,由调度器恢复 + +# 代码 +```c++ + + +``` \ No newline at end of file diff --git a/src/c/c++/thread.md b/src/c/c++/thread.md new file mode 100644 index 0000000..b7c8043 --- /dev/null +++ b/src/c/c++/thread.md @@ -0,0 +1,12 @@ +--- +aliases: +tags: +creation date: 2024-01-26 15:46 +modification date: 星期五 26日 一月 2024 15:46:22 +--- +# 线程 +CPU调度的最小单位,有线程栈2MB、线程数量有限制 + + + + diff --git a/src/c/c++/编译器特性.md b/src/c/c++/编译器特性.md new file mode 100644 index 0000000..83286a4 --- /dev/null +++ b/src/c/c++/编译器特性.md @@ -0,0 +1,21 @@ +--- +aliases: +tags: +creation date: 2024-01-26 17:15 +modification date: 星期五 26日 一月 2024 17:15:03 +--- +# c++17 +## nodiscard +编译器会检查返回值是否被忽略,支持链式传递 + +```cpp +class [[nodiscard]] A {}; +A foo() { + return A(); +} +[[nodiscard]] B bar() { + return B(); +} +std::ignore = foo(); +``` + diff --git a/src/g/go/golang.md b/src/g/go/golang.md new file mode 100644 index 0000000..8e68bae --- /dev/null +++ b/src/g/go/golang.md @@ -0,0 +1,108 @@ +--- +aliases: +tags: +creation date: 2023-09-08 14:27 +modification date: 星期五 8日 九月 2023 14:27:29 +--- +# go + +## 设计哲学 + +- 追求简洁、优雅 +- 垂直扩展:类型嵌入 +- 水平扩展:接口 +- 原生并发,轻量高效 + - select | chanel 程序级扩展 +- 面向工程,自带电池 + +## 项目工程 + +### 目录结构 + +- cmd +- internal +- pkg +- test + +### 命名规范 + +- 包 小写,单个单词 + - 包内的命名不建议含有包名 + +## 类型 + +任何类型都可以拥有方法 + +### 常量 + +无类型常量 + +对象 nil , 可直接调用函数 (单例模式) + +## 反射 + +```go +// emptyInterface is the header for an interface{} value. +type emptyInterface struct { + typ *rtype + word unsafe.Pointer +} + +// rtype is the common implementation of most values. +// It is embedded in other struct types. +// +// rtype must be kept in sync with ../runtime/type.go:/^type._type. +type rtype struct { + size uintptr + ptrdata uintptr // number of bytes in the type that can contain pointers + hash uint32 // hash of type; avoids computation in hash tables + tflag tflag // extra type information flags + align uint8 // alignment of variable with this type + fieldAlign uint8 // alignment of struct field with this type + kind uint8 // enumeration for C + // function for comparing objects of this type + // (ptr to object A, ptr to object B) -> ==? + equal func(unsafe.Pointer, unsafe.Pointer) bool + gcdata *byte // garbage collection data + str nameOff // string form + ptrToThis typeOff // type for pointer to this type, may be zero +} +``` + + + +# Doc + +https://www.cntofu.com/book/73/ch2-cgo/ch2-09-static-shared-lib.md + + + +# CMD + +```shell + go build -x F:\go\vulkan\cmd\main.go +``` + + + +# CGO + +```shell +go env -w CGO_ENABLED=1 +set CGO_CFLAGS=-IF:\Coding\GoModule\cgo +set CGO_LDFLAGS=-LF:\Coding\GoModule\cgo -I:vulkan.lib +go build -o main.exe main.go + +#C:\Users\Administrator\AppData\Roaming\go +``` + + + +# 条件编译 + +## 标签编译 + +## 文件后缀 + +https://blog.csdn.net/wohu1104/article/details/121842932 + diff --git a/src/l/english/Sound.md b/src/l/english/Sound.md new file mode 100644 index 0000000..b0987ff --- /dev/null +++ b/src/l/english/Sound.md @@ -0,0 +1,75 @@ +--- +aliases: +tags: +creation date: 2024-01-08 13:51 +modification date: 星期一 8日 一月 2024 13:51:14 +--- +# group + +## a/e/i/o/u +### an +can/fan/pan/ran +### at +bat/cat/hat/rat +### ar +card/farm/harp/park +### ay +spray +### en +hen/men/pen/ten +### er +cert/fern/herd +### et +jet/net/pet/wet +### ig +big/dig/pig/wig +### ip +dip/rip/sip/zip +### ink +drink/link/pink/sink +### ir +bird/girl/firn +### ot +cot/dot/hot/pot +### og +dog/fog/frog/log +### or +corn/fork/fort/horn +### ug +bug/hug/mug/rug +### ur +cure/curl/surf + +## mix group + +### ai +wait/maid/mail/rain +### ea +reap/seal/team +### oa +boat/coat/soap/goat +### ee +deer/heel/peel/seed/ +## silent e +### ane +cane/mane/plane/vane +### a_e +pale/tale/whale +### i_e + +bike/five/hide/kite +### o_e +bone/mole/nose/robe +### u_e +flute/cube/mule + +## other +### sh +fish/sheep/shop/wish +### wh +whale/what/when/where +### th +earth/teeth/think/thumbs/with +### ch +cheese/such/chase/each/chunk + diff --git a/src/obsidian/obsidian.md b/src/o/obsidian/obsidian.md similarity index 100% rename from src/obsidian/obsidian.md rename to src/o/obsidian/obsidian.md diff --git a/src/obsidian/templater.md b/src/o/obsidian/templater.md similarity index 100% rename from src/obsidian/templater.md rename to src/o/obsidian/templater.md diff --git a/src/o/os/int.md b/src/o/os/int.md new file mode 100644 index 0000000..fd0819f --- /dev/null +++ b/src/o/os/int.md @@ -0,0 +1,36 @@ +--- +aliases: +tags: +creation date: 2023-08-31 20:13 +modification date: 星期四 31日 八月 2023 20:13:32 +--- +# int 0x13 +磁盘读写校验寻道,以扇区为单位,内存地址为 ES * 16 + BX +```assembly +MOV AX,0x0820 +MOV ES, AX +MOV CH,0 ; 柱面0 +MOV DH,0 ; 磁头0 +MOV CL,2 ; 扇区2 +MOV AH,0x02 ; AH=0x02 : 读盘 +MOV AL,1 ; 1个扇区 +MOV BX,0 +MOV DL,0x00 ; A驱动器 +INT 0x13 ; 调用磁盘BIOS +JC error +``` +参数: +- AH=0x02;(读盘) +- AH=0x03;(写盘) +- AH=0x04;(校验) +- AH=0x0c;(寻道) +- AL=处理对象的扇区数;(只能同时处理连续的扇区) +- CH=柱面号 &0xff; +- CL=扇区号(0-5位)|(柱面号&0x300)>>2; +- DH=磁头号; +- DL=驱动器号; +- ES:BX=缓冲地址;(校验及寻道时不使用) +返回值: +- FLACS.CF = 0:没有错误,AH=0 +- FLAGS.CF =1:有错误,错误号码存入AH内(与重置(reset)功能一样) + diff --git a/src/o/os/memory.md b/src/o/os/memory.md new file mode 100644 index 0000000..75a6ef2 --- /dev/null +++ b/src/o/os/memory.md @@ -0,0 +1,31 @@ +--- +aliases: +tags: +creation date: 2023-08-31 19:12 +modification date: 星期四 31日 八月 2023 19:12:24 +--- +# memory + +## 实模式内存布局 +加载操作系统前的内存布局 16位CPU 20位地址总线 1MB内存寻址空间 +- DRAM 640kb 0x00000 ~ 0x9FFFF +- VRAM 320kb 0xA0000 ~ 0xEFFFF +- ROM 64kb 0xF0000 ~ 0xFFFFF +![v2-1ef6245cba5693f7d4d40d3e73ae2d01_1440w.png](https://cloud-1318379256.cos.ap-shanghai.myqcloud.com/obsidian/v2-1ef6245cba5693f7d4d40d3e73ae2d01_1440w.png) +## 地址分配 +### 中断表 +- 函数注册 & 调用 +- 中断调用硬件函数 +- 中断调用系统API +### MBR +- 系统盘的第一个扇区 512 字节 +- 操作系统启动程序 +- 有608kb的可用区域 +### 显示器 +- 显示适配器 +- 显示数据 +### BIOS +- bios 程序存储于主板上的ROM中 +- bios 数据与函数API +- 开机入口程序 + diff --git a/src/o/os/os.md b/src/o/os/os.md new file mode 100644 index 0000000..7d214fe --- /dev/null +++ b/src/o/os/os.md @@ -0,0 +1,24 @@ +--- +aliases: +tags: +creation date: 2023-08-31 19:02 +modification date: 星期四 31日 八月 2023 19:02:20 +--- +# os +#link/os +[自制操作系统](https://www.zhihu.com/column/c_1177746519796690944) +## BIOS +- 通电瞬间 `cs:ip` 强制初始化为 `0xF000: 0xFFF0` +- 检测内存、显卡等外设信息 +- 初始化硬件,建立中断表和中断例程 +- 加载并跳转到 MBR,检查是否以0x55 0xaa 结尾 +## MBR +- 512b 位于磁盘的第一个扇区,内存地址 0x7c00 ~ 0x7dff +- 定义装载地址 `ORG 0x7c00`,用于计算符号绝对地址 + + + + + + + diff --git a/src/r/rust/rust.md b/src/r/rust/rust.md new file mode 100644 index 0000000..6c2397e --- /dev/null +++ b/src/r/rust/rust.md @@ -0,0 +1,9 @@ +--- +aliases: +tags: +creation date: 2023-09-25 20:32 +modification date: 星期一 25日 九月 2023 20:32:08 +--- +# 语法 + + diff --git a/src/s/stl/STL源码剖析简体中文完整版(清晰扫描带目录).pdf b/src/s/stl/STL源码剖析简体中文完整版(清晰扫描带目录).pdf new file mode 100644 index 0000000..0ac3a11 Binary files /dev/null and b/src/s/stl/STL源码剖析简体中文完整版(清晰扫描带目录).pdf differ diff --git a/src/v/vulkan/vulkan go.md b/src/v/vulkan/vulkan go.md new file mode 100644 index 0000000..cf5b86c --- /dev/null +++ b/src/v/vulkan/vulkan go.md @@ -0,0 +1,10 @@ +--- +aliases: +tags: +creation date: 2024-01-17 13:47 +modification date: 星期三 17日 一月 2024 13:47:00 +--- +# vulkanapi + +## shader + diff --git a/src/v/vulkan/vulkan.md b/src/v/vulkan/vulkan.md new file mode 100644 index 0000000..7e8b92e --- /dev/null +++ b/src/v/vulkan/vulkan.md @@ -0,0 +1,272 @@ +--- +aliases: +tags: +creation date: 2023-09-16 10:13 +modification date: 星期六 16日 九月 2023 10:13:37 +--- +# 实战 + +## 导图 + +vulkan-1.dll + +- vkGetInstanceProcAddr + - vkEnumerateInstanceExtensionProperties + - vkEnumerateInstanceLayerProperties + - vkCreateInstance + +instance + +- vkEnumeratePhysicalDevices +- vkEnumerateDeviceExtensionProperties +- vkGetPhysicalDeviceFeatures +- vkGetPhysicalDeviceProperties +- vkGetPhysicalDeviceQueueFamilyProperties +- vkGetPhysicalDeviceMemoryProperties +- vkGetPhysicalDeviceFormatProperties +- vkCreateDevice +- vkGetDeviceProcAddr +- vkDestroyInstance + +## 接口 + +- 加载接口 + +```c++ +//系统接口:加载DLL +#if defined _WIN32 + vulkan_library = LoadLibrary( "vulkan-1.dll" ); +#elif defined __linux + vulkan_library = dlopen( "libvulkan.so.1", RTLD_NOW ); +#endif +//vulkan接口:获取函数指针 +#if defined _WIN32 + #define LoadFunction GetProcAddress +#elif defined __linux + #define LoadFunction dlsym +#endif +//调用vulkan接口,获取入口函数指针 +#define EXPORTED_VULKAN_FUNCTION( name ) \ + name = (PFN_##name)LoadFunction( vulkan_library, #name ); \ + if( name == nullptr ) { \ + std::cout << "Could not load exported Vulkan function named: " \ + #name << std::endl; \ + return false; \ + } + +//调用vulkan接口,获取全局函数指针 +#define GLOBAL_LEVEL_VULKAN_FUNCTION( name ) \ + name = (PFN_##name)vkGetInstanceProcAddr( nullptr, #name ); \ + if( name == nullptr ) { \ + std::cout << "Could not load global level Vulkan function named: " \ + #name << std::endl; \ + return false; \ + } + +//调用vulkan接口,获取实例函数指针 +#define INSTANCE_LEVEL_VULKAN_FUNCTION( name ) \ + name = (PFN_##name)vkGetInstanceProcAddr( instance, #name ); \ + if( name == nullptr ) { \ + std::cout << "Could not load instance-level Vulkan function named: " \ + #name << std::endl; \ + return false; \ + } + +//调用vulkan接口,获取实例扩展函数指针,需要检查实例扩展是否支持 +#define INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( name, extension ) \ + for( auto & enabled_extension : enabled_extensions ) { \ + if( std::string( enabled_extension ) == std::string( extension ) ) { \ + name = (PFN_##name)vkGetInstanceProcAddr( instance, #name ); \ + if( name == nullptr ) { \ + std::cout << "Could not load instance-level Vulkan function named: " \ + #name << std::endl; \ + return false; \ + } \ + } \ + } + +// 调用vulkan接口,获取设备函数指针 +#define DEVICE_LEVEL_VULKAN_FUNCTION( name ) \ + name = (PFN_##name)vkGetDeviceProcAddr( logical_device, #name ); \ + if( name == nullptr ) { \ + std::cout << "Could not load device-level Vulkan function named: " \ + #name << std::endl; \ + return false; \ + } + +// 调用vulkan接口,获取设备扩展函数指针,需要检查设备扩展是否支持 +#define DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( name, extension ) \ + for( auto & enabled_extension : enabled_extensions ) { \ + if( std::string( enabled_extension ) == std::string( extension ) ) { \ + name = (PFN_##name)vkGetDeviceProcAddr( logical_device, #name ); \ + if( name == nullptr ) { \ + std::cout << "Could not load device-level Vulkan function named: " \ + #name << std::endl; \ + return false; \ + } \ + } \ + } +``` + +- 销毁接口 + +```c++ +//设备接口,销毁逻辑实例 +vkDestroyDevice( logical_device, nullptr ); + +// 实例接口,销毁实例 +vkDestroyInstance( instance, nullptr ); + +//系统接口,销毁dll +#if defined _WIN32 + FreeLibrary( vulkan_library ); +#elif defined __linux + dlclose( vulkan_library ); +#endif +``` + + + +- vulkan 接口 + +```c++ +//入口接口,获取其他接口地址 +EXPORTED_VULKAN_FUNCTION( vkGetInstanceProcAddr ); + +//全局接口 +//获取支持的实例扩展列表,调用两次,一次获取大小,一次获取数据 +GLOBAL_LEVEL_VULKAN_FUNCTION( vkEnumerateInstanceExtensionProperties ); +GLOBAL_LEVEL_VULKAN_FUNCTION( vkEnumerateInstanceLayerProperties ); +//先检查实例扩展,再创建实例,才能调用实例接口 +GLOBAL_LEVEL_VULKAN_FUNCTION( vkCreateInstance ); + +//实例接口 +//获取物理设备,调用两次,一次获取大小,一次获取数据 +INSTANCE_LEVEL_VULKAN_FUNCTION( vkEnumeratePhysicalDevices ); +//获取物理设备支持的扩展,调用两次,一次获取大小,一次获取数据 +INSTANCE_LEVEL_VULKAN_FUNCTION( vkEnumerateDeviceExtensionProperties ); +//获取物理设备支持的功能 +INSTANCE_LEVEL_VULKAN_FUNCTION( vkGetPhysicalDeviceFeatures ); +//获取物理设备的基础属性 +INSTANCE_LEVEL_VULKAN_FUNCTION( vkGetPhysicalDeviceProperties ); +//获取物理设备支持的队列属性,不同队列有不同功能 +INSTANCE_LEVEL_VULKAN_FUNCTION( vkGetPhysicalDeviceQueueFamilyProperties ); +INSTANCE_LEVEL_VULKAN_FUNCTION( vkGetPhysicalDeviceMemoryProperties ); +INSTANCE_LEVEL_VULKAN_FUNCTION( vkGetPhysicalDeviceFormatProperties ); +//创建逻辑设备 需要检查扩展、功能、命令队列 +INSTANCE_LEVEL_VULKAN_FUNCTION( vkCreateDevice ); +INSTANCE_LEVEL_VULKAN_FUNCTION( vkGetDeviceProcAddr ); +INSTANCE_LEVEL_VULKAN_FUNCTION( vkDestroyInstance ); + +//实例扩展接口,需要先开启扩展 +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkGetPhysicalDeviceSurfaceSupportKHR, VK_KHR_SURFACE_EXTENSION_NAME ); +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkGetPhysicalDeviceSurfaceCapabilitiesKHR, VK_KHR_SURFACE_EXTENSION_NAME ); +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkGetPhysicalDeviceSurfaceFormatsKHR, VK_KHR_SURFACE_EXTENSION_NAME ); +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkGetPhysicalDeviceSurfacePresentModesKHR, VK_KHR_SURFACE_EXTENSION_NAME ); +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkDestroySurfaceKHR, VK_KHR_SURFACE_EXTENSION_NAME ); +#ifdef VK_USE_PLATFORM_WIN32_KHR +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkCreateWin32SurfaceKHR, VK_KHR_WIN32_SURFACE_EXTENSION_NAME ); +#elif defined VK_USE_PLATFORM_XCB_KHR +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkCreateXcbSurfaceKHR, VK_KHR_XCB_SURFACE_EXTENSION_NAME ); +#elif defined VK_USE_PLATFORM_XLIB_KHR +INSTANCE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkCreateXlibSurfaceKHR, VK_KHR_XLIB_SURFACE_EXTENSION_NAME ); +#endif + +//设备接口 +DEVICE_LEVEL_VULKAN_FUNCTION( vkGetDeviceQueue ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDeviceWaitIdle ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyDevice ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkGetBufferMemoryRequirements ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkAllocateMemory ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkBindBufferMemory ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdPipelineBarrier ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateImage ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkGetImageMemoryRequirements ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkBindImageMemory ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateImageView ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkMapMemory ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkFlushMappedMemoryRanges ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkUnmapMemory ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdCopyBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdCopyBufferToImage ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdCopyImageToBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkBeginCommandBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkEndCommandBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkQueueSubmit ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyImageView ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyImage ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkFreeMemory ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateCommandPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkAllocateCommandBuffers ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateSemaphore ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateFence ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkWaitForFences ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkResetFences ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyFence ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroySemaphore ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkResetCommandBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkFreeCommandBuffers ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkResetCommandPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyCommandPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateBufferView ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyBufferView ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkQueueWaitIdle ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateSampler ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateDescriptorSetLayout ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateDescriptorPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkAllocateDescriptorSets ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkUpdateDescriptorSets ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdBindDescriptorSets ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkFreeDescriptorSets ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkResetDescriptorPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyDescriptorPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyDescriptorSetLayout ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroySampler ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateRenderPass ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateFramebuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyFramebuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyRenderPass ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdBeginRenderPass ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdNextSubpass ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdEndRenderPass ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreatePipelineCache ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkGetPipelineCacheData ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkMergePipelineCaches ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyPipelineCache ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateGraphicsPipelines ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateComputePipelines ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyPipeline ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyEvent ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyQueryPool ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreateShaderModule ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyShaderModule ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCreatePipelineLayout ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkDestroyPipelineLayout ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdBindPipeline ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdSetViewport ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdSetScissor ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdBindVertexBuffers ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdDraw ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdDrawIndexed ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdDispatch ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdCopyImage ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdPushConstants ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdClearColorImage ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdClearDepthStencilImage ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdBindIndexBuffer ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdSetLineWidth ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdSetDepthBias ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdSetBlendConstants ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdExecuteCommands ); +DEVICE_LEVEL_VULKAN_FUNCTION( vkCmdClearAttachments ); + +//设备扩展接口,需要先开启扩展 +DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkCreateSwapchainKHR, VK_KHR_SWAPCHAIN_EXTENSION_NAME ); +DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkGetSwapchainImagesKHR, VK_KHR_SWAPCHAIN_EXTENSION_NAME ); +DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkAcquireNextImageKHR, VK_KHR_SWAPCHAIN_EXTENSION_NAME ); +DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkQueuePresentKHR, VK_KHR_SWAPCHAIN_EXTENSION_NAME ); +DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION( vkDestroySwapchainKHR, VK_KHR_SWAPCHAIN_EXTENSION_NAME ); +``` + diff --git a/src/xmake/xmake API.md b/src/x/xmake/xmake API.md similarity index 100% rename from src/xmake/xmake API.md rename to src/x/xmake/xmake API.md diff --git a/src/xmake/xmake 使用.md b/src/x/xmake/xmake 使用.md similarity index 99% rename from src/xmake/xmake 使用.md rename to src/x/xmake/xmake 使用.md index 970aa03..4ddebde 100644 --- a/src/xmake/xmake 使用.md +++ b/src/x/xmake/xmake 使用.md @@ -243,4 +243,4 @@ curl-ca-bundle.crt ## curl 慢 -连 strong vpn 就行 \ No newline at end of file +连 vpn \ No newline at end of file diff --git a/src/xmake/xmake 库.md b/src/x/xmake/xmake 库.md similarity index 59% rename from src/xmake/xmake 库.md rename to src/x/xmake/xmake 库.md index e7e3562..bab3fdb 100644 --- a/src/xmake/xmake 库.md +++ b/src/x/xmake/xmake 库.md @@ -1,3 +1,33 @@ +# 自定义 +```lua +package("libgo") +    set_homepage("https://github.com/yyzybb537/libgo") + +    set_description("libgo -- a coroutine library and a parallel Programming Library") + +    set_license("MIT") + + + +    add_urls("https://github.com/yyzybb537/libgo/archive/$(version).tar.gz") + +    add_urls("https://github.com/yyzybb537/libgo.git") + + --计算add_versions值 + --版本号来自github,下载tar.gz源文件 计算哈希值 + --xmake l hash.sha256 libgo-2.6.tar.gz +    add_versions("v2.6", "c194aa96c424cb0e41e44a32fd87e46d87832c514aba579872faff29ef5e9011") + + + +    add_deps("cmake") + +    on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package) + +        import("package.tools.cmake").install(package) + +    end) +``` # LUA ## luasocket @@ -34,7 +64,6 @@ package("luasocket") ``` - ## lua-protobuf # C++ diff --git a/src/xmake/xmake 源码.md b/src/x/xmake/xmake 源码.md similarity index 100% rename from src/xmake/xmake 源码.md rename to src/x/xmake/xmake 源码.md diff --git a/src/xmake/xmake 解析.md b/src/x/xmake/xmake 解析.md similarity index 100% rename from src/xmake/xmake 解析.md rename to src/x/xmake/xmake 解析.md diff --git a/src/xmake/xmake.md b/src/x/xmake/xmake.md similarity index 100% rename from src/xmake/xmake.md rename to src/x/xmake/xmake.md diff --git a/src/z/zfile/序列化.md b/src/z/zfile/序列化.md new file mode 100644 index 0000000..73b5b84 --- /dev/null +++ b/src/z/zfile/序列化.md @@ -0,0 +1,33 @@ +--- +aliases: +tags: +creation date: 2023-09-05 10:41 +modification date: 星期二 5日 九月 2023 10:41:01 +--- +## 对象类型 +### 集中型 +- 如磁盘文件、网络通信 +- 数据紧凑,代价小,不易修改 +- 对可变子对象修改成本大,需要重新生成整个文件 +- 需要额外的辅助信息解析对象,如字符串长度、数组大小 +### 分散型 +- 如内存对象 +- 数据分散,代价大,易修改 +- 申请内存,会有额外负担,还易造成内存碎片 +## 对象描述 +### 集中型 +- 字符串 +### 分散型 +- 一个类可以描述一类对象 +- xml、json 可描述的对象范围更大 + + + +# 大小端 + +数据从低地址向高地址无限存储 + +高位在前就是大端,低位在前就是小端 + +大端高位是0易被压缩,小端CPU计算更方便 +