Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
android/ | 03-May-2024 | - | 513 | 346 | ||
doc/ | 03-May-2024 | - | 603 | 453 | ||
fuchsia/ | 03-May-2024 | - | 204 | 120 | ||
ggp/ | 03-May-2024 | - | 201 | 122 | ||
mac/ | 03-May-2024 | - | 547 | 406 | ||
shaders/ | 03-May-2024 | - | 23,063 | 22,545 | ||
win32/ | 03-May-2024 | - | 305 | 209 | ||
xcb/ | 03-May-2024 | - | 272 | 177 | ||
BUILD.gn | D | 03-May-2024 | 6.3 KiB | 268 | 244 | |
BufferVk.cpp | D | 03-May-2024 | 23.8 KiB | 672 | 475 | |
BufferVk.h | D | 03-May-2024 | 7.3 KiB | 198 | 141 | |
CommandProcessor.cpp | D | 03-May-2024 | 2.8 KiB | 79 | 57 | |
CommandProcessor.h | D | 03-May-2024 | 2.5 KiB | 75 | 38 | |
CompilerVk.cpp | D | 03-May-2024 | 536 | 27 | 11 | |
CompilerVk.h | D | 03-May-2024 | 735 | 31 | 14 | |
ContextVk.cpp | D | 03-May-2024 | 170.5 KiB | 4,390 | 3,358 | |
ContextVk.h | D | 03-May-2024 | 44.7 KiB | 984 | 676 | |
DeviceVk.cpp | D | 03-May-2024 | 843 | 45 | 26 | |
DeviceVk.h | D | 03-May-2024 | 889 | 35 | 19 | |
DisplayVk.cpp | D | 03-May-2024 | 9 KiB | 292 | 228 | |
DisplayVk.h | D | 03-May-2024 | 4.8 KiB | 126 | 81 | |
DisplayVk_api.h | D | 03-May-2024 | 1.6 KiB | 49 | 31 | |
FenceNVVk.cpp | D | 03-May-2024 | 1.4 KiB | 53 | 33 | |
FenceNVVk.h | D | 03-May-2024 | 960 | 35 | 20 | |
FramebufferVk.cpp | D | 03-May-2024 | 72 KiB | 1,764 | 1,345 | |
FramebufferVk.h | D | 03-May-2024 | 10.6 KiB | 229 | 169 | |
GlslangWrapperVk.cpp | D | 03-May-2024 | 3.7 KiB | 99 | 74 | |
GlslangWrapperVk.h | D | 03-May-2024 | 2.4 KiB | 57 | 38 | |
ImageVk.cpp | D | 03-May-2024 | 4.9 KiB | 154 | 114 | |
ImageVk.h | D | 03-May-2024 | 1.6 KiB | 62 | 37 | |
MemoryObjectVk.cpp | D | 03-May-2024 | 8.6 KiB | 255 | 195 | |
MemoryObjectVk.h | D | 03-May-2024 | 2.1 KiB | 64 | 41 | |
OverlayVk.cpp | D | 03-May-2024 | 11.5 KiB | 279 | 199 | |
OverlayVk.h | D | 03-May-2024 | 1.7 KiB | 61 | 35 | |
PersistentCommandPool.cpp | D | 03-May-2024 | 3.1 KiB | 109 | 71 | |
PersistentCommandPool.h | D | 03-May-2024 | 1.2 KiB | 53 | 28 | |
ProgramExecutableVk.cpp | D | 03-May-2024 | 58.5 KiB | 1,456 | 1,128 | |
ProgramExecutableVk.h | D | 03-May-2024 | 10.6 KiB | 256 | 178 | |
ProgramPipelineVk.cpp | D | 03-May-2024 | 6.9 KiB | 184 | 131 | |
ProgramPipelineVk.h | D | 03-May-2024 | 1.9 KiB | 63 | 38 | |
ProgramVk.cpp | D | 03-May-2024 | 28 KiB | 797 | 625 | |
ProgramVk.h | D | 03-May-2024 | 8.9 KiB | 204 | 157 | |
QueryVk.cpp | D | 03-May-2024 | 9.6 KiB | 304 | 229 | |
QueryVk.h | D | 03-May-2024 | 2.2 KiB | 61 | 36 | |
README.md | D | 03-May-2024 | 4.2 KiB | 84 | 58 | |
RenderTargetVk.cpp | D | 03-May-2024 | 5.8 KiB | 191 | 147 | |
RenderTargetVk.h | D | 03-May-2024 | 3.5 KiB | 102 | 59 | |
RenderbufferVk.cpp | D | 03-May-2024 | 8.9 KiB | 250 | 194 | |
RenderbufferVk.h | D | 03-May-2024 | 3.4 KiB | 87 | 58 | |
RendererVk.cpp | D | 03-May-2024 | 85 KiB | 2,210 | 1,670 | |
RendererVk.h | D | 03-May-2024 | 14.8 KiB | 392 | 281 | |
ResourceVk.cpp | D | 03-May-2024 | 2.5 KiB | 118 | 80 | |
ResourceVk.h | D | 03-May-2024 | 5.5 KiB | 204 | 138 | |
SamplerVk.cpp | D | 03-May-2024 | 1.2 KiB | 51 | 30 | |
SamplerVk.h | D | 03-May-2024 | 1.1 KiB | 46 | 26 | |
SecondaryCommandBuffer.cpp | D | 03-May-2024 | 29 KiB | 616 | 589 | |
SecondaryCommandBuffer.h | D | 03-May-2024 | 53.7 KiB | 1,407 | 1,174 | |
SemaphoreVk.cpp | D | 03-May-2024 | 10.2 KiB | 274 | 193 | |
SemaphoreVk.h | D | 03-May-2024 | 1.6 KiB | 50 | 30 | |
ShaderVk.cpp | D | 03-May-2024 | 2.1 KiB | 76 | 48 | |
ShaderVk.h | D | 03-May-2024 | 911 | 34 | 17 | |
SurfaceVk.cpp | D | 03-May-2024 | 61.8 KiB | 1,664 | 1,226 | |
SurfaceVk.h | D | 03-May-2024 | 13.5 KiB | 331 | 223 | |
SyncVk.cpp | D | 03-May-2024 | 17.3 KiB | 512 | 381 | |
SyncVk.h | D | 03-May-2024 | 4.7 KiB | 143 | 99 | |
TextureVk.cpp | D | 03-May-2024 | 79.7 KiB | 1,903 | 1,447 | |
TextureVk.h | D | 03-May-2024 | 20.9 KiB | 442 | 327 | |
TransformFeedbackVk.cpp | D | 03-May-2024 | 13.3 KiB | 340 | 246 | |
TransformFeedbackVk.h | D | 03-May-2024 | 4.4 KiB | 123 | 86 | |
UtilsVk.cpp | D | 03-May-2024 | 83.2 KiB | 1,987 | 1,566 | |
UtilsVk.h | D | 03-May-2024 | 19.4 KiB | 484 | 364 | |
VertexArrayVk.cpp | D | 03-May-2024 | 39.4 KiB | 872 | 683 | |
VertexArrayVk.h | D | 03-May-2024 | 7.1 KiB | 167 | 125 | |
gen_vk_format_table.py | D | 03-May-2024 | 7.9 KiB | 245 | 181 | |
gen_vk_internal_shaders.py | D | 03-May-2024 | 25.9 KiB | 732 | 499 | |
gen_vk_mandatory_format_support_table.py | D | 03-May-2024 | 4.3 KiB | 144 | 103 | |
vk_cache_utils.cpp | D | 03-May-2024 | 87.6 KiB | 2,190 | 1,757 | |
vk_cache_utils.h | D | 03-May-2024 | 41.6 KiB | 1,063 | 733 | |
vk_caps_utils.cpp | D | 03-May-2024 | 37.9 KiB | 755 | 484 | |
vk_caps_utils.h | D | 03-May-2024 | 2.5 KiB | 82 | 51 | |
vk_ext_provoking_vertex.h | D | 03-May-2024 | 2.6 KiB | 66 | 43 | |
vk_format_map.json | D | 03-May-2024 | 18.6 KiB | 517 | 514 | |
vk_format_table_autogen.cpp | D | 03-May-2024 | 130.9 KiB | 2,609 | 2,305 | |
vk_format_utils.cpp | D | 03-May-2024 | 15.7 KiB | 407 | 309 | |
vk_format_utils.h | D | 03-May-2024 | 11.8 KiB | 322 | 250 | |
vk_google_filtering_precision.h | D | 03-May-2024 | 2.2 KiB | 53 | 30 | |
vk_headers.h | D | 03-May-2024 | 3.1 KiB | 86 | 48 | |
vk_helpers.cpp | D | 03-May-2024 | 192 KiB | 4,938 | 3,893 | |
vk_helpers.h | D | 03-May-2024 | 70.1 KiB | 1,749 | 1,217 | |
vk_internal_shaders_autogen.cpp | D | 03-May-2024 | 25.7 KiB | 475 | 439 | |
vk_internal_shaders_autogen.gni | D | 03-May-2024 | 5.8 KiB | 129 | 127 | |
vk_internal_shaders_autogen.h | D | 03-May-2024 | 8.4 KiB | 272 | 242 | |
vk_mandatory_format_support_data.json | D | 03-May-2024 | 17.7 KiB | 439 | 439 | |
vk_mandatory_format_support_table_autogen.cpp | D | 03-May-2024 | 24.2 KiB | 610 | 404 | |
vk_mem_alloc_wrapper.cpp | D | 03-May-2024 | 5.9 KiB | 144 | 115 | |
vk_mem_alloc_wrapper.h | D | 03-May-2024 | 2.5 KiB | 66 | 43 | |
vk_utils.cpp | D | 03-May-2024 | 44 KiB | 1,236 | 1,036 | |
vk_utils.h | D | 03-May-2024 | 24.6 KiB | 809 | 596 | |
vk_wrapper.h | D | 03-May-2024 | 65 KiB | 1,813 | 1,496 |
README.md
1# ANGLE: Vulkan Back-end 2 3ANGLE's Vulkan back-end implementation lives in this folder. 4 5[Vulkan](https://www.khronos.org/vulkan/) is an explicit graphics API. It has a lot in common with 6other explicit APIs such as Microsoft's [D3D12][D3D12 Guide] and Apple's 7[Metal](https://developer.apple.com/metal/). Compared to APIs like OpenGL or D3D11 explicit APIs can 8offer a number of significant benefits: 9 10 * Lower API call CPU overhead. 11 * A smaller API surface with more direct hardware control. 12 * Better support for multi-core programming. 13 * Vulkan in particular has open-source tooling and tests. 14 15[D3D12 Guide]: https://docs.microsoft.com/en-us/windows/desktop/direct3d12/directx-12-programming-guide 16 17## Back-end Design 18 19The [`RendererVk`](RendererVk.cpp) class represents an `EGLDisplay`. `RendererVk` owns shared global 20resources like the [VkDevice][VkDevice], [VkQueue][VkQueue], the [Vulkan format tables](vk_format_utils.h) 21and [internal Vulkan shaders](shaders). The [ContextVk](ContextVk.cpp) class implements the back-end 22of a front-end OpenGL Context. ContextVk processes state changes and handles action commands like 23`glDrawArrays` and `glDrawElements`. 24 25## Command recording 26 27The back-end records commands into command buffers via the the following `ContextVk` APIs: 28 29 * `endRenderPassAndGetCommandBuffer`: returns a secondary command buffer *outside* a RenderPass instance. 30 * `flushAndBeginRenderPass`: returns a secondary command buffer *inside* a RenderPass instance. 31 * `flushAndGetPrimaryCommandBuffer`: returns the primary command buffer. You should rarely need this API. 32 33*Note*: All of these commands may write out (aka flush) prior pending commands into a primary 34command buffer. When a RenderPass is open `endRenderPassAndGetCommandBuffer` will flush the 35pending RenderPass commands. `flushAndBeginRenderPass` will flush out pending commands outside a 36RenderPass to a primary buffer. On submit ANGLE submits the primary command buffer to a `VkQueue`. 37 38If you need to record inside a RenderPass, use `flushAndBeginRenderPass`. Otherwise, use 39`endRenderPassAndGetCommandBuffer`. You should rarely need to call `flushAndGetPrimaryCommandBuffer`. 40It's there for commands like debug labels, barriers and queries that need to be recorded serially on 41the primary command buffer. 42 43The back-end usually records Image and Buffer barriers through additional `ContextVk` APIs: 44 45 * `onBufferTransferRead/onBufferComputeShaderRead` and `onBufferTransferWrite/onBufferComputeShaderWrite` accumulate `VkBuffer` barriers. 46 * `onImageRead` and `onImageWrite` accumulate `VkImage` barriers. 47 * `onRenderPassImageWrite` is a special API for write barriers inside a RenderPass instance. 48 49After the back-end records commands to the primary buffer we flush (e.g. on swap) or when we call 50`ContextVk::finishToSerial`. 51 52See the [code][CommandAPIs] for more details. 53 54### Simple command recording example 55 56In this example we'll be recording a buffer copy command: 57 58``` 59 # Ensure that ANGLE sets proper read and write barriers for the Buffers. 60 ANGLE_TRY(contextVk->onBufferTransferWrite(destBuffer)); 61 ANGLE_TRY(contextVk->onBufferTransferRead(srcBuffer)); 62 63 # Get a pointer to a secondary command buffer for command recording. May "flush" the RP. 64 vk::CommandBuffer *commandBuffer; 65 ANGLE_TRY(contextVk->endRenderPassAndGetCommandBuffer(&commandBuffer)); 66 67 # Record the copy command into the secondary buffer. We're done! 68 commandBuffer->copyBuffer(srcBuffer->getBuffer(), destBuffer->getBuffer(), copyCount, copies); 69``` 70 71## Additional Reading 72 73More implementation details can be found in the `doc` directory: 74 75- [Fast OpenGL State Transitions](doc/FastOpenGLStateTransitions.md) 76- [Shader Module Compilation](doc/ShaderModuleCompilation.md) 77- [OpenGL Line Segment Rasterization](doc/OpenGLLineSegmentRasterization.md) 78- [Format Tables and Emulation](doc/FormatTablesAndEmulation.md) 79 80[VkDevice]: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkDevice.html 81[VkQueue]: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkQueue.html 82[CommandAPIs]: https://chromium.googlesource.com/angle/angle/+/df31624eaf3df986a0bdf3f58a87b79b0cc8db5c/src/libANGLE/renderer/vulkan/ContextVk.h#620 83 84