1Zink 2==== 3 4Overview 5-------- 6 7The Zink driver is a Gallium driver that emits Vulkan API calls instead 8of targeting a specific GPU architecture. This can be used to get full 9desktop OpenGL support on devices that only support Vulkan. 10 11Features 12-------- 13 14The feature-level of Zink depends on two things; what's implemented in Zink, 15as well as the features of the Vulkan driver. 16 17OpenGL 2.1 18^^^^^^^^^^ 19 20OpenGL 2.1 is the minimum version Zink can support, and will always be 21exposed, given Vulkan support. There's a few features that are required 22for correct behavior, but not all of these are validated; instead you'll 23see rendering-issues and likely validation error, or even crashes. 24 25Here's a list of those requirements: 26 27* Vulkan 1.0 28* ``VkPhysicalDeviceFeatures``: 29 30 * ``logicOp`` 31 * ``fillModeNonSolid`` 32 * ``wideLines`` 33 * ``largePoints`` 34 * ``alphaToOne`` 35 * ``shaderClipDistance`` 36 37* Instance extensions: 38 39 * `VK_KHR_get_physical_device_properties2`_ 40 * `VK_KHR_external_memory_capabilities`_ 41 42* Device extensions: 43 44 * `VK_KHR_maintenance1`_ 45 * `VK_KHR_external_memory`_ 46 47OpenGL 3.0 48^^^^^^^^^^ 49 50For OpenGL 3.0 support, the following additional device extensions are 51required to be exposed and fully supported: 52 53* `VK_EXT_transform_feedback`_ 54* `VK_EXT_conditional_rendering`_ 55 56 57OpenGL 3.1 58^^^^^^^^^^ 59 60For OpenGL 3.1 support, the following additional ``VkPhysicalDeviceLimits`` 61are required: 62 63* ``maxPerStageDescriptorSamplers`` ≥ 16 64 65OpenGL 3.2 66^^^^^^^^^^ 67 68For OpenGL 3.2 support, the following additional ``VkPhysicalDeviceFeatures`` 69are required to be supported, although some of these might not actually get 70verified: 71 72* ``depthClamp`` 73* ``geometryShader`` 74* ``shaderTessellationAndGeometryPointSize`` 75 76OpenGL 3.3 77^^^^^^^^^^ 78 79For OpenGL 3.3 support, the following additional ``VkPhysicalDeviceFeatures`` 80are required to be supported, although some of these might not actually get 81verified: 82 83* ``VkPhysicalDeviceFeatures`` 84 85 * ``occlusionQueryPrecise`` 86 87* Device extensions: 88 89 * `VK_EXT_vertex_attribute_divisor`_ 90 91Debugging 92--------- 93 94There's a few tools that are useful for debugging Zink, like this environment 95variable: 96 97.. envvar:: ZINK_DEBUG <flags> ("") 98 99``nir`` 100 Print the NIR form of all shaders to stderr. 101``spirv`` 102 Write the binary SPIR-V form of all compiled shaders to a file in the 103 current directory, and print a message with the filename to stderr. 104``tgsi`` 105 Print the TGSI form of TGSI shaders to stderr. 106``validation`` 107 Dump Validation layer output. 108 109Vulkan Validation Layers 110^^^^^^^^^^^^^^^^^^^^^^^^ 111 112Another useful tool for debugging is the `Vulkan Validation Layers 113<https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/README.md>`_. 114 115The validation layers effectively insert extra checking between Zink and the 116Vulkan driver, pointing out incorrect usage of the Vulkan API. The layers can 117be enabled by setting the environment variable :envvar:`VK_INSTANCE_LAYERS` to 118"VK_LAYER_KHRONOS_validation". You can read more about the Validation Layers 119in the link above. 120 121IRC 122--- 123 124In order to make things a bit easier to follow, we have decided to create our 125own IRC channel. If you're interested in contributing, or have any technical 126questions, don't hesitate to visit `#zink on FreeNode 127<irc://irc.freenode.net/zink>`_ and say hi! 128 129 130.. _VK_KHR_get_physical_device_properties2: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_get_physical_device_properties2.html 131.. _VK_KHR_external_memory_capabilities: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_external_memory_capabilities.html 132.. _VK_KHR_maintenance1: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_maintenance1.html 133.. _VK_KHR_external_memory: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_KHR_external_memory.html 134.. _VK_EXT_transform_feedback: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_EXT_transform_feedback.html 135.. _VK_EXT_conditional_rendering: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_EXT_conditional_rendering.html 136.. _VK_EXT_vertex_attribute_divisor: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VK_EXT_vertex_attribute_divisor.html 137