| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Extensions.VK_KHR_push_descriptor
- pattern VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR :: VkStructureType
- pattern VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR :: VkDescriptorUpdateTemplateType
- pattern VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR :: VkDescriptorSetLayoutCreateFlagBits
- pattern VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION :: Integral a => a
- pattern VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME :: (Eq a, IsString a) => a
- vkCmdPushDescriptorSetKHR :: ("commandBuffer" ::: VkCommandBuffer) -> ("pipelineBindPoint" ::: VkPipelineBindPoint) -> ("layout" ::: VkPipelineLayout) -> ("set" ::: Word32) -> ("descriptorWriteCount" ::: Word32) -> ("pDescriptorWrites" ::: Ptr VkWriteDescriptorSet) -> IO ()
- vkCmdPushDescriptorSetWithTemplateKHR :: ("commandBuffer" ::: VkCommandBuffer) -> ("descriptorUpdateTemplate" ::: VkDescriptorUpdateTemplate) -> ("layout" ::: VkPipelineLayout) -> ("set" ::: Word32) -> ("pData" ::: Ptr ()) -> IO ()
- data VkPhysicalDevicePushDescriptorPropertiesKHR = VkPhysicalDevicePushDescriptorPropertiesKHR {
- vkSType :: VkStructureType
- vkPNext :: Ptr ()
- vkMaxPushDescriptors :: Word32
Documentation
pattern VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR :: VkStructureType Source #
pattern VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR :: VkDescriptorUpdateTemplateType Source #
VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR specifies that
the descriptor update template will be used for push descriptor updates
only.
pattern VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR :: VkDescriptorSetLayoutCreateFlagBits Source #
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR specifies that
descriptor sets must not be allocated using this layout, and
descriptors are instead pushed by vkCmdPushDescriptorSetKHR.
pattern VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION :: Integral a => a Source #
pattern VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME :: (Eq a, IsString a) => a Source #
vkCmdPushDescriptorSetKHR :: ("commandBuffer" ::: VkCommandBuffer) -> ("pipelineBindPoint" ::: VkPipelineBindPoint) -> ("layout" ::: VkPipelineLayout) -> ("set" ::: Word32) -> ("descriptorWriteCount" ::: Word32) -> ("pDescriptorWrites" ::: Ptr VkWriteDescriptorSet) -> IO () Source #
vkCmdPushDescriptorSetKHR - Pushes descriptor updates into a command buffer
Parameters
commandBufferis the command buffer that the descriptors will be recorded in.
pipelineBindPointis aVkPipelineBindPointindicating 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.layoutis aVkPipelineLayoutobject used to program the bindings.setis the set number of the descriptor set in the pipeline layout that will be updated.descriptorWriteCountis the number of elements in thepDescriptorWritesarray.pDescriptorWritesis a pointer to an array ofVkWriteDescriptorSetstructures describing the descriptors to be updated.
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 have
undefined contents. 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 become invalid.
Valid descriptors must be pushed for all bindings that any shaders in a pipeline access, 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. However, if none of the shaders in a pipeline statically use certain bindings in the push descriptor set, then those descriptors need not be valid.
Push descriptors do not use dynamic offsets. Instead, the corresponding
non-dynamic descriptor types can be used and the offset member of
VkDescriptorBufferInfo can be
changed each time the descriptor is written.
Each element of pDescriptorWrites is interpreted as in
VkWriteDescriptorSet, except the
dstSet member is ignored.
To push an immutable sampler, use a
VkWriteDescriptorSet with
dstBinding and dstArrayElement selecting the immutable sampler’s
binding. If the descriptor type is VK_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 VK_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
pipelineBindPointmust be supported by thecommandBuffer’s parentVkCommandPool’s queue family
setmust be less thanVkPipelineLayoutCreateInfo::setLayoutCountprovided whenlayoutwas createdsetmust be the unique set number in the pipeline layout that uses a descriptor set layout that was created withVK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandle
pipelineBindPointmust be a validVkPipelineBindPointvaluelayoutmust be a validVkPipelineLayouthandlepDescriptorWritesmust be a valid pointer to an array ofdescriptorWriteCountvalidVkWriteDescriptorSetstructurescommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations descriptorWriteCountmust be greater than0- Both of
commandBuffer, andlayoutmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
+-----------------+-----------------+-----------------+-----------------+ | <#VkCommandBuff | <#vkCmdBeginRen | <#VkQueueFlagBi | <#synchronizati | | erLevel Command | derPass Render | ts Supported Qu | on-pipeline-sta | | Buffer Levels> | Pass Scope> | eue Types> | ges-types Pipel | | | | | ine Type> | +=================+=================+=================+=================+ | Primary | Both | Graphics | | | Secondary | | Compute | | +-----------------+-----------------+-----------------+-----------------+
See Also
VkCommandBuffer,
VkPipelineBindPoint,
VkPipelineLayout,
VkWriteDescriptorSet
vkCmdPushDescriptorSetWithTemplateKHR :: ("commandBuffer" ::: VkCommandBuffer) -> ("descriptorUpdateTemplate" ::: VkDescriptorUpdateTemplate) -> ("layout" ::: VkPipelineLayout) -> ("set" ::: Word32) -> ("pData" ::: Ptr ()) -> IO () Source #
vkCmdPushDescriptorSetWithTemplateKHR - Pushes descriptor updates into a command buffer using a descriptor update template
Parameters
commandBufferis the command buffer that the descriptors will be recorded in.
descriptorUpdateTemplateA descriptor update template which defines how to interpret the descriptor information in pData.layoutis aVkPipelineLayoutobject used to program the bindings. It must be compatible with the layout used to create thedescriptorUpdateTemplatehandle.setis the set number of the descriptor set in the pipeline layout that will be updated. This must be the same number used to create thedescriptorUpdateTemplatehandle.pDataPoints to memory which contains the descriptors for the templated update.
Description
Valid Usage
- The pipelineBindPoint specified during the creation of the
descriptor update template must be supported by the
commandBuffer’s parentVkCommandPool’s queue family
pDatamust be a valid pointer to a memory that contains one or more valid instances ofVkDescriptorImageInfo,VkDescriptorBufferInfo, orVkBufferViewin a layout defined bydescriptorUpdateTemplatewhen it was created withvkCreateDescriptorUpdateTemplateKHR
Valid Usage (Implicit)
commandBuffermust be a validVkCommandBufferhandle
descriptorUpdateTemplatemust be a validVkDescriptorUpdateTemplatehandlelayoutmust be a validVkPipelineLayouthandlecommandBuffermust be in the recording state- The
VkCommandPoolthatcommandBufferwas allocated from must support graphics, or compute operations - Each of
commandBuffer,descriptorUpdateTemplate, andlayoutmust have been created, allocated, or retrieved from the sameVkDevice
Host Synchronization
- Host access to
commandBuffermust be externally synchronized
- Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
Command Properties
+-----------------+-----------------+-----------------+-----------------+ | <#VkCommandBuff | <#vkCmdBeginRen | <#VkQueueFlagBi | <#synchronizati | | erLevel Command | derPass Render | ts Supported Qu | on-pipeline-sta | | Buffer Levels> | Pass Scope> | eue Types> | ges-types Pipel | | | | | ine Type> | +=================+=================+=================+=================+ | Primary | Both | Graphics | | | Secondary | | Compute | | +-----------------+-----------------+-----------------+-----------------+
API example.
struct AppBufferView {
VkBufferView bufferView;
uint32_t applicationRelatedInformation;
};
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 an 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
VkCommandBuffer,
VkDescriptorUpdateTemplate,
VkPipelineLayout
data VkPhysicalDevicePushDescriptorPropertiesKHR Source #
VkPhysicalDevicePushDescriptorPropertiesKHR - Structure describing push descriptor limits that can be supported by an implementation
Members
The members of the VkPhysicalDevicePushDescriptorPropertiesKHR
structure describe the following implementation-dependent limits:
Description
maxPushDescriptorsis the maximum number of descriptors that can be used in a descriptor set created withVK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHRset.
Valid Usage (Implicit)
sTypemust beVK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR
See Also
Constructors
| VkPhysicalDevicePushDescriptorPropertiesKHR | |
Fields
| |