vulkan-2.0.0.1: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Core11.Promoted_from_VK_KHR_descriptor_update_template

Synopsis

Documentation

newtype VkDescriptorUpdateTemplateType Source #

VkDescriptorUpdateTemplateType - Indicates the valid usage of the descriptor update template

See Also

VkDescriptorUpdateTemplateCreateInfo

Instances
Eq VkDescriptorUpdateTemplateType Source # 
Instance details
Ord VkDescriptorUpdateTemplateType Source # 
Instance details
Read VkDescriptorUpdateTemplateType Source # 
Instance details
Show VkDescriptorUpdateTemplateType Source # 
Instance details
Storable VkDescriptorUpdateTemplateType Source # 
Instance details

pattern VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET :: VkDescriptorUpdateTemplateType Source #

VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET specifies that the descriptor update template will be used for descriptor set updates only.

newtype VkDescriptorUpdateTemplateCreateFlags Source #

VkDescriptorUpdateTemplateCreateFlags - Reserved for future use

Description

VkDescriptorUpdateTemplateCreateFlags is a bitmask type for setting a mask, but is currently reserved for future use.

See Also

VkDescriptorUpdateTemplateCreateInfo

Instances
Eq VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details
Ord VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details
Read VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details
Show VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details
Storable VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details
Bits VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details

Methods

(.&.) :: VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags #

(.|.) :: VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags #

xor :: VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags #

complement :: VkDescriptorUpdateTemplateCreateFlags -> VkDescriptorUpdateTemplateCreateFlags #

shift :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

rotate :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

zeroBits :: VkDescriptorUpdateTemplateCreateFlags #

bit :: Int -> VkDescriptorUpdateTemplateCreateFlags #

setBit :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

clearBit :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

complementBit :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

testBit :: VkDescriptorUpdateTemplateCreateFlags -> Int -> Bool #

bitSizeMaybe :: VkDescriptorUpdateTemplateCreateFlags -> Maybe Int #

bitSize :: VkDescriptorUpdateTemplateCreateFlags -> Int #

isSigned :: VkDescriptorUpdateTemplateCreateFlags -> Bool #

shiftL :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

unsafeShiftL :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

shiftR :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

unsafeShiftR :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

rotateL :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

rotateR :: VkDescriptorUpdateTemplateCreateFlags -> Int -> VkDescriptorUpdateTemplateCreateFlags #

popCount :: VkDescriptorUpdateTemplateCreateFlags -> Int #

FiniteBits VkDescriptorUpdateTemplateCreateFlags Source # 
Instance details

vkCreateDescriptorUpdateTemplate :: ("device" ::: VkDevice) -> ("pCreateInfo" ::: Ptr VkDescriptorUpdateTemplateCreateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pDescriptorUpdateTemplate" ::: Ptr VkDescriptorUpdateTemplate) -> IO VkResult Source #

vkCreateDescriptorUpdateTemplate - Create a new descriptor update template

Parameters

  • device is the logical device that creates the descriptor update template.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • pCreateInfo must be a valid pointer to a valid VkDescriptorUpdateTemplateCreateInfo structure
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
  • pDescriptorUpdateTemplate must be a valid pointer to a VkDescriptorUpdateTemplate handle

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_ERROR_OUT_OF_DEVICE_MEMORY

See Also

VkAllocationCallbacks, VkDescriptorUpdateTemplate, VkDescriptorUpdateTemplateCreateInfo, VkDevice

vkDestroyDescriptorUpdateTemplate :: ("device" ::: VkDevice) -> ("descriptorUpdateTemplate" ::: VkDescriptorUpdateTemplate) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO () Source #

vkDestroyDescriptorUpdateTemplate - Destroy a descriptor update template object

Parameters

  • device is the logical device that has been used to create the descriptor update template
  • descriptorUpdateTemplate is the descriptor update template to destroy.
  • pAllocator controls host memory allocation as described in the Memory Allocation chapter.

Valid Usage

  • If VkAllocationCallbacks were provided when descriptorSetLayout was created, a compatible set of callbacks must be provided here
  • If no VkAllocationCallbacks were provided when descriptorSetLayout was created, pAllocator must be NULL

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • If descriptorUpdateTemplate is not VK_NULL_HANDLE, descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle
  • If pAllocator is not NULL, pAllocator must be a valid pointer to a valid VkAllocationCallbacks structure
  • If descriptorUpdateTemplate is a valid handle, it must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to descriptorUpdateTemplate must be externally synchronized

See Also

VkAllocationCallbacks, VkDescriptorUpdateTemplate, VkDevice

vkUpdateDescriptorSetWithTemplate :: ("device" ::: VkDevice) -> ("descriptorSet" ::: VkDescriptorSet) -> ("descriptorUpdateTemplate" ::: VkDescriptorUpdateTemplate) -> ("pData" ::: Ptr ()) -> IO () Source #

vkUpdateDescriptorSetWithTemplate - Update the contents of a descriptor set object using an update template

Parameters

  • device is the logical device that updates the descriptor sets.
  • descriptorSet is the descriptor set to update
  • descriptorUpdateTemplate is the VkDescriptorUpdateTemplate which specifies the update mapping between pData and the descriptor set to update.
  • pData is a pointer to memory which contains one or more structures of VkDescriptorImageInfo, VkDescriptorBufferInfo, or VkBufferView used to write the descriptors.

Valid Usage

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • descriptorSet must be a valid VkDescriptorSet handle
  • descriptorUpdateTemplate must be a valid VkDescriptorUpdateTemplate handle
  • descriptorUpdateTemplate must have been created, allocated, or retrieved from device

Host Synchronization

  • Host access to descriptorSet must be externally synchronized

API example.

struct AppBufferView {
    VkBufferView bufferView;
    uint32_t     applicationRelatedInformation;
};

struct AppDataStructure
{
    VkDescriptorImageInfo  imageInfo;          // a single image info
    VkDescriptorBufferInfo bufferInfoArray[3]; // 3 buffer infos in an array
    AppBufferView          bufferView[2];      // An application defined structure containing a bufferView
    // ... some more application related data
};

const VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] =
{
    // binding to a single image descriptor
    {
        0,                                           // binding
        0,                                           // dstArrayElement
        1,                                           // descriptorCount
        VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,   // descriptorType
        offsetof(AppDataStructure, imageInfo),       // offset
        0                                            // stride is not required if descriptorCount is 1.
    },

    // binding to an array of buffer descriptors
    {
        0,                                           // binding
        0,                                           // dstArrayElement
        3,                                           // descriptorCount
        VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,           // descriptorType
        offsetof(AppDataStructure, bufferInfoArray), // offset
        sizeof(VkDescriptorBufferInfo)               // stride, descriptor buffer infos are compact
    },

    // binding to an array of buffer views
    {
        0,                                           // binding
        3,                                           // dstArrayElement
        1,                                           // descriptorCount
        VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER,     // descriptorType
        offsetof(AppDataStructure, bufferView),      // offset
        sizeof(AppBufferView)                        // stride, bufferViews do not have to be compact
    },
};

// create an descriptor update template for descriptor set updates
const VkDescriptorUpdateTemplateCreateInfo createInfo =
{
    VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO,  // sType
    NULL,                                                          // pNext
    0,                                                             // flags
    3,                                                             // descriptorUpdateEntryCount
    descriptorUpdateTemplateEntries,                               // pDescriptorUpdateEntries
    VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET,         // templateType
    myLayout,                                                      // descriptorSetLayout
    0,                                                             // pipelineBindPoint, ignored by given templateType
    0,                                                             // pipelineLayout, ignored by given templateType
    0,                                                             // set, ignored by given templateType
};

VkDescriptorUpdateTemplate myDescriptorUpdateTemplate;
myResult = vkCreateDescriptorUpdateTemplate(
    myDevice,
    &createInfo,
    NULL,
    &myDescriptorUpdateTemplate);
}


AppDataStructure appData;

// fill appData here or cache it in your engine
vkUpdateDescriptorSetWithTemplate(myDevice, myDescriptorSet, myDescriptorUpdateTemplate, &appData);

See Also

VkDescriptorSet, VkDescriptorUpdateTemplate, VkDevice

data VkDescriptorUpdateTemplateEntry Source #

VkDescriptorUpdateTemplateEntry - Describes a single descriptor update of the descriptor update template

Members

  • dstBinding is the descriptor binding to update when using this descriptor update template.
  • dstArrayElement is the starting element in the array belonging to dstBinding.
  • descriptorCount is the number of descriptors to update. If descriptorCount is greater than the number of remaining array elements in the destination binding, those affect consecutive bindings in a manner similar to VkWriteDescriptorSet above.
  • descriptorType is a VkDescriptorType specifying the type of the descriptor.
  • offset is the offset in bytes of the first binding in the raw data structure.
  • stride is the stride in bytes between two consecutive array elements of the descriptor update informations in the raw data structure. The actual pointer ptr for each array element j of update entry i is computed using the following formula:

        const char *ptr = (const char *)pData + pDescriptorUpdateEntries[i].offset + j * pDescriptorUpdateEntries[i].stride

    The stride is useful in case the bindings are stored in structs along with other data.

Valid Usage

  • dstBinding must be a valid binding in the descriptor set layout implicitly specified when using a descriptor update template to update descriptors.
  • dstArrayElement and descriptorCount must be less than or equal to the number of array elements in the descriptor set binding implicitly specified when using a descriptor update template to update descriptors, and all applicable consecutive bindings, as described by {html_spec_relative}#descriptorsets-updates-consecutive

Valid Usage (Implicit)

See Also

VkDescriptorType, VkDescriptorUpdateTemplateCreateInfo

data VkDescriptorUpdateTemplateCreateInfo Source #

VkDescriptorUpdateTemplateCreateInfo - Structure specifying parameters of a newly created descriptor update template

Valid Usage

  • If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, descriptorSetLayout must be a valid VkDescriptorSetLayout handle
  • If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineBindPoint must be a valid VkPipelineBindPoint value
  • If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, pipelineLayout must be a valid VkPipelineLayout handle
  • If templateType is VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, set must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO
  • pNext must be NULL
  • flags must be 0
  • pDescriptorUpdateEntries must be a valid pointer to an array of descriptorUpdateEntryCount valid VkDescriptorUpdateTemplateEntry structures
  • templateType must be a valid VkDescriptorUpdateTemplateType value
  • If descriptorSetLayout is not VK_NULL_HANDLE, descriptorSetLayout must be a valid VkDescriptorSetLayout handle
  • descriptorUpdateEntryCount must be greater than 0
  • Both of descriptorSetLayout, and pipelineLayout that are valid handles must have been created, allocated, or retrieved from the same VkDevice

See Also

VkDescriptorSetLayout, VkDescriptorUpdateTemplateCreateFlags, VkDescriptorUpdateTemplateEntry, VkDescriptorUpdateTemplateType, VkPipelineBindPoint, VkPipelineLayout, VkStructureType, vkCreateDescriptorUpdateTemplate, vkCreateDescriptorUpdateTemplateKHR

Constructors

VkDescriptorUpdateTemplateCreateInfo 

Fields

  • vkSType :: VkStructureType

    sType is the type of this structure.

  • vkPNext :: Ptr ()

    pNext is NULL or a pointer to an extension-specific structure.

  • vkFlags :: VkDescriptorUpdateTemplateCreateFlags

    flags is reserved for future use.

  • vkDescriptorUpdateEntryCount :: Word32

    descriptorUpdateEntryCount is the number of elements in the pDescriptorUpdateEntries array.

  • vkPDescriptorUpdateEntries :: Ptr VkDescriptorUpdateTemplateEntry

    pDescriptorUpdateEntries is a pointer to an array of VkDescriptorUpdateTemplateEntry structures describing the descriptors to be updated by the descriptor update template.

  • vkTemplateType :: VkDescriptorUpdateTemplateType

    templateType Specifies the type of the descriptor update template. If set to VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET it can only be used to update descriptor sets with a fixed descriptorSetLayout. If set to VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR it can only be used to push descriptor sets using the provided pipelineBindPoint, pipelineLayout, and set number.

  • vkDescriptorSetLayout :: VkDescriptorSetLayout

    descriptorSetLayout is the descriptor set layout the parameter update template will be used with. All descriptor sets which are going to be updated through the newly created descriptor update template must be created with this layout. descriptorSetLayout is the descriptor set layout used to build the descriptor update template. All descriptor sets which are going to be updated through the newly created descriptor update template must be created with a layout that matches (is the same as, or defined identically to) this layout. This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET.

  • vkPipelineBindPoint :: VkPipelineBindPoint

    pipelineBindPoint is a VkPipelineBindPoint indicating whether the descriptors will be used by graphics pipelines or compute pipelines. This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR

  • vkPipelineLayout :: VkPipelineLayout

    pipelineLayout is a VkPipelineLayout object used to program the bindings. This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR

  • vkSet :: Word32

    set is the set number of the descriptor set in the pipeline layout that will be updated. This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR