这个系列是GAMES106-现代图形绘制流水线原理与实践(GAMES 106: Intro to Modern Rendering Pipeline)的同步课程笔记。课程内容涉及现代图形绘制流水线的基础原理,实践方法,以及优化技巧。本节课主要介绍Vulkan的绘制对象创建、内存管理以及调试方法和工具。
Vulkan对象创建
Vulkan中的重要对象包括FrameBuffer、Buffer、Pipeline、DescriptorSets以及DescriptorPool等。

创建Vulkan对象的方法都非常相似,一般包括4个参数:
LogicDevice
:Vulkan对象的逻辑设备VkObjectCreateInfo
:Vulkan对象相关的描述符userAllocator
:内存分配器用于内存管理- Object对象地址
调用函数后会返回VkResult
描述创建对象的过程是否成功。

RenderPass
RenderPass定义了一次图形绘制的最小单元。


FrameBuffer
FrameBuffer定义了绘制输出的相关信息。

Buffer
Buffer包含了顶点、索引等各种信息。

Pipeline

Image

PipelineLayout

Vulkan内存管理
Vulkan在创建对象时可以由用户指定内存分配器来实现手动内存管理。在渲染中我们需要区分CPU和GPU上的内存。








Vulkan绘制

调试工具及方法


Reference
PREVIOUS绘制流水线原理I