|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| android/ | | 23-Nov-2023 | - | 958 | 624 |
| display/ | | 23-Nov-2023 | - | 222 | 132 |
| doc/ | | 23-Nov-2023 | - | 731 | 559 |
| fuchsia/ | | 23-Nov-2023 | - | 205 | 120 |
| ggp/ | | 23-Nov-2023 | - | 198 | 119 |
| headless/ | | 23-Nov-2023 | - | 201 | 112 |
| mac/ | | 23-Nov-2023 | - | 553 | 412 |
| null/ | | 23-Nov-2023 | - | 175 | 99 |
| shaders/ | | 23-Nov-2023 | - | 32,616 | 30,614 |
| win32/ | | 23-Nov-2023 | - | 315 | 216 |
| xcb/ | | 23-Nov-2023 | - | 290 | 191 |
| BUILD.gn | D | 23-Nov-2023 | 6.9 KiB | 288 | 264 |
| BufferVk.cpp | D | 23-Nov-2023 | 36.1 KiB | 945 | 681 |
| BufferVk.h | D | 23-Nov-2023 | 9.2 KiB | 228 | 173 |
| CLCommandQueueVk.cpp | D | 23-Nov-2023 | 510 | 20 | 8 |
| CLCommandQueueVk.h | D | 23-Nov-2023 | 745 | 29 | 14 |
| CLContextVk.cpp | D | 23-Nov-2023 | 451 | 18 | 6 |
| CLContextVk.h | D | 23-Nov-2023 | 677 | 28 | 14 |
| CLDeviceVk.cpp | D | 23-Nov-2023 | 1.4 KiB | 59 | 39 |
| CLDeviceVk.h | D | 23-Nov-2023 | 1.3 KiB | 41 | 24 |
| CLEventVk.cpp | D | 23-Nov-2023 | 429 | 18 | 6 |
| CLEventVk.h | D | 23-Nov-2023 | 651 | 28 | 14 |
| CLKernelVk.cpp | D | 23-Nov-2023 | 440 | 18 | 6 |
| CLKernelVk.h | D | 23-Nov-2023 | 664 | 28 | 14 |
| CLMemoryVk.cpp | D | 23-Nov-2023 | 440 | 18 | 6 |
| CLMemoryVk.h | D | 23-Nov-2023 | 664 | 28 | 14 |
| CLPlatformVk.cpp | D | 23-Nov-2023 | 3.1 KiB | 108 | 82 |
| CLPlatformVk.h | D | 23-Nov-2023 | 1.5 KiB | 53 | 32 |
| CLProgramVk.cpp | D | 23-Nov-2023 | 451 | 18 | 6 |
| CLProgramVk.h | D | 23-Nov-2023 | 677 | 28 | 14 |
| CLSamplerVk.cpp | D | 23-Nov-2023 | 451 | 18 | 6 |
| CLSamplerVk.h | D | 23-Nov-2023 | 677 | 28 | 14 |
| CommandGraph.cpp | D | 23-Nov-2023 | 50.7 KiB | 1,379 | 1,097 |
| CommandGraph.h | D | 23-Nov-2023 | 31 KiB | 814 | 507 |
| CommandProcessor.cpp | D | 23-Nov-2023 | 46.6 KiB | 1,365 | 1,093 |
| CommandProcessor.h | D | 23-Nov-2023 | 21.7 KiB | 569 | 407 |
| CompilerVk.cpp | D | 23-Nov-2023 | 537 | 27 | 11 |
| CompilerVk.h | D | 23-Nov-2023 | 735 | 31 | 14 |
| ContextVk.cpp | D | 23-Nov-2023 | 253.7 KiB | 6,346 | 4,709 |
| ContextVk.h | D | 23-Nov-2023 | 57.4 KiB | 1,226 | 843 |
| DebugAnnotatorVk.cpp | D | 23-Nov-2023 | 5.2 KiB | 145 | 125 |
| DebugAnnotatorVk.h | D | 23-Nov-2023 | 1.3 KiB | 43 | 25 |
| DeviceVk.cpp | D | 23-Nov-2023 | 843 | 45 | 26 |
| DeviceVk.h | D | 23-Nov-2023 | 889 | 35 | 19 |
| DisplayVk.cpp | D | 23-Nov-2023 | 10.2 KiB | 325 | 255 |
| DisplayVk.h | D | 23-Nov-2023 | 6.6 KiB | 168 | 107 |
| DisplayVk_api.h | D | 23-Nov-2023 | 1.9 KiB | 59 | 37 |
| FenceNVVk.cpp | D | 23-Nov-2023 | 1.5 KiB | 59 | 38 |
| FenceNVVk.h | D | 23-Nov-2023 | 960 | 35 | 20 |
| FramebufferVk.cpp | D | 23-Nov-2023 | 122.4 KiB | 2,878 | 2,141 |
| FramebufferVk.h | D | 23-Nov-2023 | 12.7 KiB | 274 | 203 |
| GlslangWrapperVk.cpp | D | 23-Nov-2023 | 2.9 KiB | 72 | 51 |
| GlslangWrapperVk.h | D | 23-Nov-2023 | 1.8 KiB | 48 | 30 |
| ImageVk.cpp | D | 23-Nov-2023 | 5.6 KiB | 165 | 116 |
| ImageVk.h | D | 23-Nov-2023 | 1.6 KiB | 62 | 37 |
| MemoryObjectVk.cpp | D | 23-Nov-2023 | 9.3 KiB | 264 | 198 |
| MemoryObjectVk.h | D | 23-Nov-2023 | 2.2 KiB | 66 | 43 |
| OWNERS | D | 23-Nov-2023 | 61 | 4 | 3 |
| OverlayVk.cpp | D | 23-Nov-2023 | 11.9 KiB | 290 | 207 |
| OverlayVk.h | D | 23-Nov-2023 | 1.8 KiB | 62 | 36 |
| PersistentCommandPool.cpp | D | 23-Nov-2023 | 3.6 KiB | 118 | 78 |
| PersistentCommandPool.h | D | 23-Nov-2023 | 1.2 KiB | 53 | 28 |
| ProgramExecutableVk.cpp | D | 23-Nov-2023 | 82.4 KiB | 1,975 | 1,566 |
| ProgramExecutableVk.h | D | 23-Nov-2023 | 14.1 KiB | 329 | 246 |
| ProgramPipelineVk.cpp | D | 23-Nov-2023 | 11.2 KiB | 273 | 209 |
| ProgramPipelineVk.h | D | 23-Nov-2023 | 2.3 KiB | 70 | 45 |
| ProgramVk.cpp | D | 23-Nov-2023 | 30.1 KiB | 830 | 651 |
| ProgramVk.h | D | 23-Nov-2023 | 10 KiB | 230 | 187 |
| QueryVk.cpp | D | 23-Nov-2023 | 22.5 KiB | 675 | 484 |
| QueryVk.h | D | 23-Nov-2023 | 3.3 KiB | 87 | 51 |
| README.md | D | 23-Nov-2023 | 4.3 KiB | 88 | 64 |
| RenderTargetVk.cpp | D | 23-Nov-2023 | 14.4 KiB | 390 | 301 |
| RenderTargetVk.h | D | 23-Nov-2023 | 9.4 KiB | 219 | 111 |
| RenderbufferVk.cpp | D | 23-Nov-2023 | 14.8 KiB | 367 | 283 |
| RenderbufferVk.h | D | 23-Nov-2023 | 5.8 KiB | 132 | 89 |
| RendererVk.cpp | D | 23-Nov-2023 | 135.4 KiB | 3,436 | 2,587 |
| RendererVk.h | D | 23-Nov-2023 | 21.7 KiB | 571 | 420 |
| ResourceVk.cpp | D | 23-Nov-2023 | 3.1 KiB | 142 | 101 |
| ResourceVk.h | D | 23-Nov-2023 | 5.7 KiB | 210 | 142 |
| SamplerVk.cpp | D | 23-Nov-2023 | 1.1 KiB | 49 | 29 |
| SamplerVk.h | D | 23-Nov-2023 | 1 KiB | 42 | 24 |
| SecondaryCommandBuffer.cpp | D | 23-Nov-2023 | 29.8 KiB | 634 | 609 |
| SecondaryCommandBuffer.h | D | 23-Nov-2023 | 55.9 KiB | 1,479 | 1,240 |
| SemaphoreVk.cpp | D | 23-Nov-2023 | 10.7 KiB | 280 | 198 |
| SemaphoreVk.h | D | 23-Nov-2023 | 1.6 KiB | 50 | 30 |
| ShaderVk.cpp | D | 23-Nov-2023 | 3.9 KiB | 123 | 81 |
| ShaderVk.h | D | 23-Nov-2023 | 912 | 34 | 17 |
| SurfaceVk.cpp | D | 23-Nov-2023 | 77.6 KiB | 1,995 | 1,432 |
| SurfaceVk.h | D | 23-Nov-2023 | 15.3 KiB | 357 | 242 |
| SyncVk.cpp | D | 23-Nov-2023 | 19.2 KiB | 609 | 444 |
| SyncVk.h | D | 23-Nov-2023 | 4.6 KiB | 141 | 99 |
| TextureVk.cpp | D | 23-Nov-2023 | 133.2 KiB | 3,108 | 2,252 |
| TextureVk.h | D | 23-Nov-2023 | 28 KiB | 572 | 407 |
| TransformFeedbackVk.cpp | D | 23-Nov-2023 | 14.2 KiB | 366 | 283 |
| TransformFeedbackVk.h | D | 23-Nov-2023 | 5 KiB | 138 | 95 |
| UtilsVk.cpp | D | 23-Nov-2023 | 147 KiB | 3,517 | 2,559 |
| UtilsVk.h | D | 23-Nov-2023 | 23.5 KiB | 583 | 442 |
| VertexArrayVk.cpp | D | 23-Nov-2023 | 43.6 KiB | 948 | 746 |
| VertexArrayVk.h | D | 23-Nov-2023 | 7.2 KiB | 165 | 124 |
| cl_types.h | D | 23-Nov-2023 | 518 | 23 | 10 |
| gen_vk_format_table.py | D | 23-Nov-2023 | 9.1 KiB | 289 | 215 |
| gen_vk_internal_shaders.py | D | 23-Nov-2023 | 29.3 KiB | 815 | 562 |
| gen_vk_mandatory_format_support_table.py | D | 23-Nov-2023 | 5.2 KiB | 147 | 109 |
| vk_cache_utils.cpp | D | 23-Nov-2023 | 165.1 KiB | 3,940 | 3,025 |
| vk_cache_utils.h | D | 23-Nov-2023 | 67.4 KiB | 1,756 | 1,235 |
| vk_caps_utils.cpp | D | 23-Nov-2023 | 61.1 KiB | 1,266 | 787 |
| vk_caps_utils.h | D | 23-Nov-2023 | 2.5 KiB | 82 | 51 |
| vk_format_map.json | D | 23-Nov-2023 | 19 KiB | 505 | 502 |
| vk_format_table_autogen.cpp | D | 23-Nov-2023 | 136.7 KiB | 2,827 | 2,519 |
| vk_format_utils.cpp | D | 23-Nov-2023 | 17.8 KiB | 452 | 342 |
| vk_format_utils.h | D | 23-Nov-2023 | 7.9 KiB | 209 | 129 |
| vk_helpers.cpp | D | 23-Nov-2023 | 319.4 KiB | 8,110 | 6,380 |
| vk_helpers.h | D | 23-Nov-2023 | 113.2 KiB | 2,696 | 1,926 |
| vk_internal_shaders_autogen.cpp | D | 23-Nov-2023 | 30.1 KiB | 549 | 508 |
| vk_internal_shaders_autogen.gni | D | 23-Nov-2023 | 6.8 KiB | 151 | 149 |
| vk_internal_shaders_autogen.h | D | 23-Nov-2023 | 8.2 KiB | | |
| vk_mandatory_format_support_data.json | D | 23-Nov-2023 | 17.7 KiB | 439 | 439 |
| vk_mandatory_format_support_table_autogen.cpp | D | 23-Nov-2023 | 14 KiB | 300 | 282 |
| vk_mem_alloc_wrapper.cpp | D | 23-Nov-2023 | 6.7 KiB | 162 | 131 |
| vk_mem_alloc_wrapper.h | D | 23-Nov-2023 | 2.7 KiB | 71 | 46 |
| vk_utils.cpp | D | 23-Nov-2023 | 54 KiB | 1,491 | 1,204 |
| vk_utils.h | D | 23-Nov-2023 | 34.1 KiB | 1,058 | 792 |
| vk_wrapper.h | D | 23-Nov-2023 | 68.3 KiB | 1,909 | 1,577 |
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 following `ContextVk` APIs:
28
29 * `beginNewRenderPass`: Writes out (aka flushes) prior pending commands into a primary command
30 buffer, then starts a new render pass. Returns a secondary command buffer *inside* a render pass
31 instance.
32 * `getOutsideRenderPassCommandBuffer`: May flush prior command buffers and close the render pass if
33 necessary, in addition to issuing the appropriate barriers. Returns a secondary command buffer
34 *outside* a render pass instance.
35 * `getStartedRenderPassCommands`: Returns a reference to the currently open render pass' commands
36 buffer.
37
38The back-end (mostly) records Image and Buffer barriers through additional `CommandBufferAccess`
39APIs, the result of which is passed to `getOutsideRenderPassCommandBuffer`. Note that the
40barriers are not actually recorded until `getOutsideRenderPassCommandBuffer` is called:
41
42 * `onBufferTransferRead` and `onBufferComputeShaderRead` accumulate `VkBuffer` read barriers.
43 * `onBufferTransferWrite` and `onBufferComputeShaderWrite` accumulate `VkBuffer` write barriers.
44 * `onBuffferSelfCopy` is a special case for `VkBuffer` self copies. It behaves the same as write.
45 * `onImageTransferRead` and `onImageComputerShadeRead` accumulate `VkImage` read barriers.
46 * `onImageTransferWrite` and `onImageComputerShadeWrite` accumulate `VkImage` write barriers.
47 * `onImageRenderPassRead` and `onImageRenderPassWrite` accumulate `VkImage` barriers inside a
48 started RenderPass.
49
50After the back-end records commands to the primary buffer and we flush (e.g. on swap) or when we call
51`ContextVk::finishToSerial`, ANGLE submits the primary command buffer to a `VkQueue`.
52
53See the [code][CommandAPIs] for more details.
54
55### Simple command recording example
56
57In this example we'll be recording a buffer copy command:
58
59```
60 // Ensure that ANGLE sets proper read and write barriers for the Buffers.
61 vk::CommandBufferAccess access;
62 access.onBufferTransferWrite(destBuffer);
63 access.onBufferTransferRead(srcBuffer);
64
65 // Get a pointer to a secondary command buffer for command recording.
66 vk::CommandBuffer *commandBuffer;
67 ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
68
69 // Record the copy command into the secondary buffer. We're done!
70 commandBuffer->copyBuffer(srcBuffer->getBuffer(), destBuffer->getBuffer(), copyCount, copies);
71```
72
73## Additional Reading
74
75More implementation details can be found in the `doc` directory:
76
77- [Fast OpenGL State Transitions](doc/FastOpenGLStateTransitions.md)
78- [Shader Module Compilation](doc/ShaderModuleCompilation.md)
79- [OpenGL Line Segment Rasterization](doc/OpenGLLineSegmentRasterization.md)
80- [Format Tables and Emulation](doc/FormatTablesAndEmulation.md)
81- [Deferred Clears](doc/DeferredClears.md)
82- [Queries](doc/Queries.md)
83
84[VkDevice]: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkDevice.html
85[VkQueue]: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkQueue.html
86[CommandAPIs]: https://chromium.googlesource.com/angle/angle/+/df31624eaf3df986a0bdf3f58a87b79b0cc8db5c/src/libANGLE/renderer/vulkan/ContextVk.h#620
87
88