Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Name
VK_KHR_push_descriptor - device extension
VK_KHR_push_descriptor
- Name String
VK_KHR_push_descriptor
- Extension Type
- Device extension
- Registered Extension Number
- 81
- Revision
- 2
- Ratification Status
- Ratified
- Extension and Version Dependencies
- VK_KHR_get_physical_device_properties2
- Contact
Other Extension Metadata
- Last Modified Date
- 2017-09-12
- IP Status
- No known IP claims.
- Contributors
- Jeff Bolz, NVIDIA
- Michael Worcester, Imagination Technologies
Description
This extension allows descriptors to be written into the command buffer, while the implementation is responsible for managing their memory. Push descriptors may enable easier porting from older APIs and in some cases can be more efficient than writing descriptors into descriptor sets.
New Commands
If VK_KHR_descriptor_update_template is supported:
If Version 1.1 is supported:
New Structures
New Enum Constants
KHR_PUSH_DESCRIPTOR_SPEC_VERSION
Extending
DescriptorSetLayoutCreateFlagBits
:Extending
StructureType
:
If VK_KHR_descriptor_update_template is supported:
If Version 1.1 is supported:
Version History
Revision 1, 2016-10-15 (Jeff Bolz)
- Internal revisions
Revision 2, 2017-09-12 (Tobias Hector)
- Added interactions with Vulkan 1.1
See Also
PhysicalDevicePushDescriptorPropertiesKHR
, cmdPushDescriptorSetKHR
Document Notes
For more information, see the Vulkan Specification
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- cmdPushDescriptorSetKHR :: forall io. MonadIO io => CommandBuffer -> PipelineBindPoint -> PipelineLayout -> ("set" ::: Word32) -> ("descriptorWrites" ::: Vector (SomeStruct WriteDescriptorSet)) -> io ()
- cmdPushDescriptorSetWithTemplateKHR :: forall io. MonadIO io => CommandBuffer -> DescriptorUpdateTemplate -> PipelineLayout -> ("set" ::: Word32) -> ("data" ::: Ptr ()) -> io ()
- data PhysicalDevicePushDescriptorPropertiesKHR = PhysicalDevicePushDescriptorPropertiesKHR {}
- type KHR_PUSH_DESCRIPTOR_SPEC_VERSION = 2
- pattern KHR_PUSH_DESCRIPTOR_SPEC_VERSION :: forall a. Integral a => a
- type KHR_PUSH_DESCRIPTOR_EXTENSION_NAME = "VK_KHR_push_descriptor"
- pattern KHR_PUSH_DESCRIPTOR_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
cmdPushDescriptorSetKHR Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> PipelineBindPoint |
|
-> PipelineLayout |
|
-> ("set" ::: Word32) |
|
-> ("descriptorWrites" ::: Vector (SomeStruct WriteDescriptorSet)) |
|
-> 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
bound pipeline commands
with the pipeline type set by 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 drawing or
dispatching 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 thecommandBuffer
’s parentCommandPool
’s queue family
-
set
must be less thanPipelineLayoutCreateInfo
::setLayoutCount
provided whenlayout
was created -
set
must be the unique set number in the pipeline layout that uses a descriptor set layout that was created withDESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
- For each
element i where
pDescriptorWrites
[i].descriptorType
isDESCRIPTOR_TYPE_SAMPLED_IMAGE
,DESCRIPTOR_TYPE_STORAGE_IMAGE
, orDESCRIPTOR_TYPE_INPUT_ATTACHMENT
,pDescriptorWrites
[i].pImageInfo
must be a valid pointer to an array ofpDescriptorWrites
[i].descriptorCount
validDescriptorImageInfo
structures
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
pipelineBindPoint
must be a validPipelineBindPoint
value -
layout
must be a validPipelineLayout
handle -
pDescriptorWrites
must be a valid pointer to an array ofdescriptorWriteCount
validWriteDescriptorSet
structures -
commandBuffer
must be in the recording state - The
CommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations - This command must only be called outside of a video coding scope
-
descriptorWriteCount
must be greater than0
- Both of
commandBuffer
, andlayout
must have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
'
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary Secondary | Both | Outside | Graphics Compute | State |
See Also
VK_KHR_push_descriptor,
CommandBuffer
,
PipelineBindPoint
,
PipelineLayout
,
WriteDescriptorSet
cmdPushDescriptorSetWithTemplateKHR Source #
:: forall io. MonadIO io | |
=> CommandBuffer |
|
-> DescriptorUpdateTemplate |
|
-> PipelineLayout |
|
-> ("set" ::: Word32) |
|
-> ("data" ::: Ptr ()) |
|
-> 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 thecommandBuffer
’s parentCommandPool
’s queue family
-
pData
must be a valid pointer to a memory containing one or more valid instances ofDescriptorImageInfo
,DescriptorBufferInfo
, orBufferView
in a layout defined bydescriptorUpdateTemplate
when it was created withcreateDescriptorUpdateTemplate
-
layout
must be compatible with the layout used to createdescriptorUpdateTemplate
-
descriptorUpdateTemplate
must have been created with atemplateType
ofDESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR
-
set
must be the same value used to createdescriptorUpdateTemplate
-
set
must be less thanPipelineLayoutCreateInfo
::setLayoutCount
provided whenlayout
was created -
set
must be the unique set number in the pipeline layout that uses a descriptor set layout that was created withDESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR
Valid Usage (Implicit)
-
commandBuffer
must be a validCommandBuffer
handle
-
descriptorUpdateTemplate
must be a validDescriptorUpdateTemplate
handle -
layout
must be a validPipelineLayout
handle -
commandBuffer
must be in the recording state -
The
CommandPool
thatcommandBuffer
was allocated from must support graphics, or compute operations - This command must only be called outside of a video coding scope
- Each of
commandBuffer
,descriptorUpdateTemplate
, andlayout
must have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to
commandBuffer
must be externally synchronized
- Host access to the
CommandPool
thatcommandBuffer
was allocated from must be externally synchronized
Command Properties
'
Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
---|---|---|---|---|
Primary Secondary | Both | Outside | Graphics Compute | State |
API example
struct AppDataStructure { VkDescriptorImageInfo imageInfo; // a single image info // ... some more application related data }; const VkDescriptorUpdateTemplateEntry descriptorUpdateTemplateEntries[] = { // binding to a single image descriptor { .binding = 0, .dstArrayElement = 0, .descriptorCount = 1, .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, .offset = offsetof(AppDataStructure, imageInfo), .stride = 0 // not required if descriptorCount is 1 } }; // create a descriptor update template for push descriptor set updates const VkDescriptorUpdateTemplateCreateInfo createInfo = { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, .pNext = NULL, .flags = 0, .descriptorUpdateEntryCount = 1, .pDescriptorUpdateEntries = descriptorUpdateTemplateEntries, .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR, .descriptorSetLayout = 0, // ignored by given templateType .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, .pipelineLayout = myPipelineLayout, .set = 0, }; 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
VK_KHR_descriptor_update_template,
VK_KHR_push_descriptor,
VK_VERSION_1_1,
CommandBuffer
,
DescriptorUpdateTemplate
,
PipelineLayout
data PhysicalDevicePushDescriptorPropertiesKHR Source #
VkPhysicalDevicePushDescriptorPropertiesKHR - Structure describing push descriptor limits that can be supported by an implementation
Description
If the PhysicalDevicePushDescriptorPropertiesKHR
structure is included
in the pNext
chain of the
PhysicalDeviceProperties2
structure passed to
getPhysicalDeviceProperties2
,
it is filled in with each corresponding implementation-dependent
property.
Valid Usage (Implicit)
See Also
PhysicalDevicePushDescriptorPropertiesKHR | |
|
Instances
type KHR_PUSH_DESCRIPTOR_SPEC_VERSION = 2 Source #
pattern KHR_PUSH_DESCRIPTOR_SPEC_VERSION :: forall a. Integral a => a Source #
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 #