vulkan-3.5: Bindings to the Vulkan graphics API.
Safe HaskellNone
LanguageHaskell2010

Vulkan.Extensions.VK_KHR_push_descriptor

Synopsis

Documentation

cmdPushDescriptorSetKHR Source #

Arguments

:: forall io. MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer that the descriptors will be recorded in.

-> PipelineBindPoint

pipelineBindPoint is a PipelineBindPoint indicating whether the descriptors will be used by graphics pipelines or compute pipelines. There is a separate set of push descriptor bindings for each of graphics and compute, so binding one does not disturb the other.

-> PipelineLayout

layout is a PipelineLayout object used to program the bindings.

-> ("set" ::: Word32)

set is the set number of the descriptor set in the pipeline layout that will be updated.

-> ("descriptorWrites" ::: Vector (SomeStruct WriteDescriptorSet))

pDescriptorWrites is a pointer to an array of WriteDescriptorSet structures describing the descriptors to be updated.

-> io () 

vkCmdPushDescriptorSetKHR - Pushes descriptor updates into a command buffer

Description

Push descriptors are a small bank of descriptors whose storage is internally managed by the command buffer rather than being written into a descriptor set and later bound to a command buffer. Push descriptors allow for incremental updates of descriptors without managing the lifetime of descriptor sets.

When a command buffer begins recording, all push descriptors are undefined. Push descriptors can be updated incrementally and cause shaders to use the updated descriptors for subsequent rendering commands (either compute or graphics, according to the pipelineBindPoint) until the descriptor is overwritten, or else until the set is disturbed as described in Pipeline Layout Compatibility. When the set is disturbed or push descriptors with a different descriptor set layout are set, all push descriptors are undefined.

Push descriptors that are statically used by a pipeline must not be undefined at the time that a draw or dispatch command is recorded to execute using that pipeline. This includes immutable sampler descriptors, which must be pushed before they are accessed by a pipeline (the immutable samplers are pushed, rather than the samplers in pDescriptorWrites). Push descriptors that are not statically used can remain undefined.

Push descriptors do not use dynamic offsets. Instead, the corresponding non-dynamic descriptor types can be used and the offset member of DescriptorBufferInfo can be changed each time the descriptor is written.

Each element of pDescriptorWrites is interpreted as in WriteDescriptorSet, except the dstSet member is ignored.

To push an immutable sampler, use a WriteDescriptorSet with dstBinding and dstArrayElement selecting the immutable sampler’s binding. If the descriptor type is DESCRIPTOR_TYPE_SAMPLER, the pImageInfo parameter is ignored and the immutable sampler is taken from the push descriptor set layout in the pipeline layout. If the descriptor type is DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, the sampler member of the pImageInfo parameter is ignored and the immutable sampler is taken from the push descriptor set layout in the pipeline layout.

Valid Usage

  • pipelineBindPoint must be supported by the commandBuffer’s parent CommandPool’s queue family

Valid Usage (Implicit)

  • pipelineBindPoint must be a valid PipelineBindPoint value
  • layout must be a valid PipelineLayout handle
  • pDescriptorWrites must be a valid pointer to an array of descriptorWriteCount valid WriteDescriptorSet structures
  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support graphics, or compute operations
  • descriptorWriteCount must be greater than 0
  • Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same Device

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type
Primary Secondary Both Graphics Compute

See Also

CommandBuffer, PipelineBindPoint, PipelineLayout, WriteDescriptorSet

cmdPushDescriptorSetWithTemplateKHR Source #

Arguments

:: forall io. MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer that the descriptors will be recorded in.

-> DescriptorUpdateTemplate

descriptorUpdateTemplate is a descriptor update template defining how to interpret the descriptor information in pData.

-> PipelineLayout

layout is a PipelineLayout object used to program the bindings. It must be compatible with the layout used to create the descriptorUpdateTemplate handle.

-> ("set" ::: Word32)

set is the set number of the descriptor set in the pipeline layout that will be updated. This must be the same number used to create the descriptorUpdateTemplate handle.

-> ("data" ::: Ptr ())

pData is a pointer to memory containing descriptors for the templated update.

-> io () 

vkCmdPushDescriptorSetWithTemplateKHR - Pushes descriptor updates into a command buffer using a descriptor update template

Valid Usage

  • The pipelineBindPoint specified during the creation of the descriptor update template must be supported by the commandBuffer’s parent CommandPool’s queue family

Valid Usage (Implicit)

  • descriptorUpdateTemplate must be a valid DescriptorUpdateTemplate handle
  • layout must be a valid PipelineLayout handle
  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support graphics, or compute operations
  • Each of commandBuffer, descriptorUpdateTemplate, and layout must have been created, allocated, or retrieved from the same Device

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer Levels Render Pass Scope Supported Queue Types Pipeline Type
Primary Secondary Both Graphics Compute

API example.

struct AppDataStructure
{
    VkDescriptorImageInfo  imageInfo;          // a single image info
    // ... 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
    }
};

// create a descriptor update template for descriptor set updates
const VkDescriptorUpdateTemplateCreateInfo createInfo =
{
    VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO,  // sType
    NULL,                                                      // pNext
    0,                                                         // flags
    1,                                                         // descriptorUpdateEntryCount
    descriptorUpdateTemplateEntries,                           // pDescriptorUpdateEntries
    VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR,   // templateType
    0,                                                         // descriptorSetLayout, ignored by given templateType
    VK_PIPELINE_BIND_POINT_GRAPHICS,                           // pipelineBindPoint
    myPipelineLayout,                                          // pipelineLayout
    0,                                                         // set
};

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

AppDataStructure appData;
// fill appData here or cache it in your engine
vkCmdPushDescriptorSetWithTemplateKHR(myCmdBuffer, myDescriptorUpdateTemplate, myPipelineLayout, 0,&appData);

See Also

CommandBuffer, DescriptorUpdateTemplate, PipelineLayout

data PhysicalDevicePushDescriptorPropertiesKHR Source #

VkPhysicalDevicePushDescriptorPropertiesKHR - Structure describing push descriptor limits that can be supported by an implementation

Members

The members of the PhysicalDevicePushDescriptorPropertiesKHR structure describe the following implementation-dependent limits:

Description

If the PhysicalDevicePushDescriptorPropertiesKHR structure is included in the pNext chain of PhysicalDeviceProperties2, it is filled with the implementation-dependent limits.

Valid Usage (Implicit)

See Also

StructureType

Constructors

PhysicalDevicePushDescriptorPropertiesKHR 

Fields

Instances

Instances details
Eq PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

Show PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

Generic PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

Storable PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

FromCStruct PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

ToCStruct PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

Zero PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

type Rep PhysicalDevicePushDescriptorPropertiesKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_KHR_push_descriptor

type Rep PhysicalDevicePushDescriptorPropertiesKHR = D1 ('MetaData "PhysicalDevicePushDescriptorPropertiesKHR" "Vulkan.Extensions.VK_KHR_push_descriptor" "vulkan-3.5-inplace" 'False) (C1 ('MetaCons "PhysicalDevicePushDescriptorPropertiesKHR" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxPushDescriptors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Word32)))

type KHR_PUSH_DESCRIPTOR_EXTENSION_NAME = "VK_KHR_push_descriptor" Source #

pattern KHR_PUSH_DESCRIPTOR_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #