CsPaint  1.0.0
Graphics Terminology

Vulkan Terminology

Instance
Connection between your application and the Vulkan library
Typically your application will only create one
Every other Vulkan call relies on passing this instance or some data associated with this instance
Context
Vulkan instance is similar to an OpenGL context
Context is not a term used in the Vulkan API
Surface
A term for the window region where images are rendered
Native window support is not handled directly in the API, it is implemented in platform extensions
Memory Heap
Provides storage for buffers which will be accessed by the GPU
Every buffer must be created and managed by the user
Memory is allocated from a memory heap
The buffer is then bound to the allocated memory
Any memory which is visible to the GPU will be in the list of all memory heaps
There are usually multiple heaps available
Certain heaps can only be used for specific types of buffers
Vertex Buffer
Coordinates of all vertices which describes the geometry for the image being rendered
Triangles are the most widely used shape
There can be as few as three vertices, typically thousands for a given image
Uniform Buffer
Contains data which is applied to every vertex
For example, transformations can be used to shift the geometry and render the image somewhere other than the center
Vertex Shader
Transforms a 3D position into 2D coordinates
Executes once per vertex
Tessellation Shader
Decomposes shapes into smaller components, optional shader
Geometry Shader
Alters the vertex shader output, optional shader
Fragment Shader
uses lighting and textures to calculate colors
executes at least once per pixel or fragment (partial pixel)
Pipeline
Before a draw command is added to a command buffer you must create a pipeline object which sets a whole lot of options
Shader handles, descriptor sets, push constants, depth buffer
Winding direction, culling options, viewport
Stencil, scissor, blending
Command Buffer
Accumulates draw commands which are executed on the GPU at a later time
Only way to synchronize these commands is by using a barrier
  • Set semaphore, query semaphore
  • Wait for pipeline stage (such as wait for a vertex shader to finish)
Frame Buffer
Typically contains one image
No default buffer exists since displaying an image is optional
A frame buffer us not required if no images are displayed
Depth Buffer
A 3D mesh has perspective and to draw it realistically some triangles must appear in front of other triangles
A depth buffer is used to determine what part of the mesh is closer to the camera
Misconfiguring this buffer will result in far away objects being rendered on top of closer objects
Render Pass
Added for improved performance on mobile
  • OpenGL and DirectX 12 do not have a render pass equivalent
For tile based GPU support
  • common in mobile, uncommon on desktop computers
A pipeline needs information about color channels, the depth buffer, possible image sampling, etc
All of this information is split into one or more render passes
begin command buffer, begin render pass
add commands for this one pass
end render pass, end command buffer
Swapchain
A set of buffers where the GPU can render
In Vulkan there is no default frame buffer
Creating a swapchain is the only way to create an empty frame buffer
Each frame buffer will hold a single image which is waiting to be presented on the surface
A single swap chain can contain many frame buffers
Platform specific, supplied through “extensions” which are requested when you create the Vulkan instance
Graphics Queue
Used to generate an image
Present Queue
Used to copy images to the screen
Computation Queue
Used to run general purpose computations
Transfer Queue
Used to copy data between CPU memory and GPU memory
Fence
Used to synchronize work between the CPU and the GPU
Status of a fence can be accessed from your program
Semaphore
Used to synchronize work occurring on the GPU
Semaphore dependencies are set up in your program however they are observed only on the GPU
Not visible to the CPU nor can you query their status
Winding Direction
Must be specified as part of the pipeline
Conventionally clockwise winding is used
The direction is used to determine whether a given triangle is facing the camera (front facing) or facing away (back facing)
Back Face Culling
Is the process of discarding triangles which are back facing since these are not normally visible to the viewer
There is no default so it must be set on or off in the pipeline
Triangles are "culled" early in the rendering pipeline
Increases efficiency by reducing the number of fragments which are processed
Push Constants
A way to provide a small amount of uniform data to shaders
Scissor
Scissor test restricts drawing to the specified rectangle
Test is always enabled and can not be turned off
Extent
Structure containing width and height
Defines things like the size of the screen or the render area
Viewport
Specifies a region of the frame buffer which should be refreshed, potentially complicated to determine