Binary shader code can be retrieved from a shader object using the command:
// Provided by VK_EXT_shader_object VkResult vkGetShaderBinaryDataEXT( VkDevice device, VkShaderEXT shader, size_t* pDataSize, void* pData);
deviceis the logical device that shader object was created from.
shaderis the shader object to retrieve binary shader code from.
pDataSizeis a pointer to a
size_tvalue related to the size of the binary shader code, as described below.
NULLor a pointer to a buffer.
NULL, then the size of the binary shader code of the
shader object, in bytes, is returned in
pDataSize must point to a variable set by the user to the
size of the buffer, in bytes, pointed to by
pData, and on return the
variable is overwritten with the amount of data actually written to
pDataSize is less than the size of the binary shader code, nothing
is written to
VK_INCOMPLETE will be returned instead
The behavior of this command when
Binary shader code retrieved using
vkGetShaderBinaryDataEXT can be
passed to a subsequent call to vkCreateShadersEXT on a compatible
physical device by specifying
VK_SHADER_CODE_TYPE_BINARY_EXT in the
codeType member of
The shader code returned by repeated calls to this function with the same
VkShaderEXT is guaranteed to be invariant for the lifetime of the
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.