# vkDestroyShaderEXT(3) Manual Page

## Name

vkDestroyShaderEXT - Destroy a shader object

Loading… please wait.

## C Specification

To destroy a shader object, call:

    // Provided by VK_EXT_shader_object
    void vkDestroyShaderEXT(
        VkDevice                                    device,
        VkShaderEXT                                 shader,
        const VkAllocationCallbacks*                pAllocator);

## Parameters

- `device` is the logical device that destroys the shader object.

- `shader` is the handle of the shader object to destroy.

- `pAllocator` controls host memory allocation as described in the Memory Allocation chapter.

## Description

Destroying a shader object used by one or more command buffers in the recording or executable state causes those command buffers to move into the invalid state.

Valid Usage

- VUID-vkDestroyShaderEXT-None-08481
  The `shaderObject` feature must be enabled

- VUID-vkDestroyShaderEXT-shader-08482
  All submitted commands that refer to `shader` must have completed execution

- VUID-vkDestroyShaderEXT-pAllocator-08483
  If `VkAllocationCallbacks` were provided when `shader` was created, a compatible set of callbacks must be provided here

- VUID-vkDestroyShaderEXT-pAllocator-08484
  If no `VkAllocationCallbacks` were provided when `shader` was created, `pAllocator` must be `NULL`

Valid Usage (Implicit)

- VUID-vkDestroyShaderEXT-device-parameter
  `device` must be a valid VkDevice handle

- VUID-vkDestroyShaderEXT-shader-parameter
  If `shader` is not VK_NULL_HANDLE, `shader` must be a valid VkShaderEXT handle

- VUID-vkDestroyShaderEXT-pAllocator-parameter
  If `pAllocator` is not `NULL`, `pAllocator` must be a valid pointer to a valid VkAllocationCallbacks structure

- VUID-vkDestroyShaderEXT-shader-parent
  If `shader` is a valid handle, it must have been created, allocated, or retrieved from `device`

Host Synchronization

- Host access to `shader` must be externally synchronized

## See Also

VK_EXT_shader_object, VkAllocationCallbacks, VkDevice, VkShaderEXT

## Document Notes

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.

## Copyright

Copyright 2014-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0