All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.vulkan.KHRPushDescriptor Maven / Gradle / Ivy

Go to download

A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.

There is a newer version: 3.3.4
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.vulkan;

import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;

/**
 * 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.
 * 
 * 
Examples
* *

None.

* *
*
Name String
*
{@code VK_KHR_push_descriptor}
*
Extension Type
*
Device extension
*
Registered Extension Number
*
81
*
Revision
*
1
*
Extension and Version Dependencies
*
    *
  • Requires Vulkan 1.0
  • *
  • Requires {@link KHRGetPhysicalDeviceProperties2 VK_KHR_get_physical_device_properties2}
  • *
*
Contact
*
    *
  • Jeff Bolz @jbolz
  • *
*
Last Modified Date
*
2016-10-15
*
IP Status
*
No known IP claims.
*
Contributors
*
    *
  • Jeff Bolz, NVIDIA
  • *
  • Michael Worcester, Imagination Technologies
  • *
*
*/ public class KHRPushDescriptor { /** The extension specification version. */ public static final int VK_KHR_PUSH_DESCRIPTOR_SPEC_VERSION = 1; /** The extension name. */ public static final String VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME = "VK_KHR_push_descriptor"; /** Extends {@code VkStructureType}. */ public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000; /** Extends {@code VkDescriptorSetLayoutCreateFlagBits}. */ public static final int VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x1; protected KHRPushDescriptor() { throw new UnsupportedOperationException(); } static boolean isAvailable(VKCapabilitiesDevice caps) { return checkFunctions( caps.vkCmdPushDescriptorSetKHR ); } // --- [ vkCmdPushDescriptorSetKHR ] --- /** * Unsafe version of: {@link #vkCmdPushDescriptorSetKHR CmdPushDescriptorSetKHR} * * @param descriptorWriteCount the number of elements in the {@code pDescriptorWrites} array. */ public static void nvkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, int pipelineBindPoint, long layout, int set, int descriptorWriteCount, long pDescriptorWrites) { long __functionAddress = commandBuffer.getCapabilities().vkCmdPushDescriptorSetKHR; if (CHECKS) { check(__functionAddress); VkWriteDescriptorSet.validate(pDescriptorWrites, descriptorWriteCount); } callPJPV(__functionAddress, commandBuffer.address(), pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); } /** * Pushes descriptor updates into a command buffer. * *
C Specification
* *

In addition to allocating descriptor sets and binding them to a command buffer, an application can record descriptor updates into the command buffer.

* *

To push descriptor updates into a command buffer, call:

* *
     * void vkCmdPushDescriptorSetKHR(
     *     VkCommandBuffer                             commandBuffer,
     *     VkPipelineBindPoint                         pipelineBindPoint,
     *     VkPipelineLayout                            layout,
     *     uint32_t                                    set,
     *     uint32_t                                    descriptorWriteCount,
     *     const VkWriteDescriptorSet*                 pDescriptorWrites);
* *
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 {@code 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 {@code offset} member of {@link VkDescriptorBufferInfo} can be changed each time the descriptor is written.

* *

Each element of {@code pDescriptorWrites} is interpreted as in {@link VkWriteDescriptorSet}, except the {@code dstSet} member is ignored.

* *

To push an immutable sampler, use a {@link VkWriteDescriptorSet} with {@code dstBinding} and {@code dstArrayElement} selecting the immutable sampler's binding. If the descriptor type is {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLER DESCRIPTOR_TYPE_SAMPLER}, the {@code 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 {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}, the {@code sampler} member of the {@code pImageInfo} parameter is ignored and the immutable sampler is taken from the push descriptor set layout in the pipeline layout.

* *
Valid Usage
* *
    *
  • {@code pipelineBindPoint} must be supported by the {@code commandBuffer}’s parent {@code VkCommandPool}’s queue family
  • *
  • {@code set} must be less than {@link VkPipelineLayoutCreateInfo}{@code ::setLayoutCount} provided when {@code layout} was created
  • *
  • {@code set} must be the unique set number in the pipeline layout that uses a descriptor set layout that was created with {@link #VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR}
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code commandBuffer} must be a valid {@code VkCommandBuffer} handle
  • *
  • {@code pipelineBindPoint} must be a valid {@code VkPipelineBindPoint} value
  • *
  • {@code layout} must be a valid {@code VkPipelineLayout} handle
  • *
  • {@code pDescriptorWrites} must be a valid pointer to an array of {@code descriptorWriteCount} valid {@link VkWriteDescriptorSet} structures
  • *
  • {@code commandBuffer} must be in the recording state
  • *
  • The {@code VkCommandPool} that {@code commandBuffer} was allocated from must support graphics, or compute operations
  • *
  • {@code descriptorWriteCount} must be greater than 0
  • *
  • Both of {@code commandBuffer}, and {@code layout} must have been created, allocated, or retrieved from the same {@code VkDevice}
  • *
* *
Host Synchronization
* *
    *
  • Host access to {@code commandBuffer} must be externally synchronized
  • *
  • Host access to the {@code VkCommandPool} that {@code commandBuffer} was allocated from must be externally synchronized
  • *
* *
Command Properties
* * * * *
Command Buffer LevelsRender Pass ScopeSupported Queue TypesPipeline Type
Primary SecondaryBothGraphics Compute
* *
See Also
* *

{@link VkWriteDescriptorSet}

* * @param commandBuffer the command buffer that the descriptors will be recorded in. * @param pipelineBindPoint a {@code VkPipelineBindPoint} 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. * @param layout a {@code VkPipelineLayout} object used to program the bindings. * @param set the set number of the descriptor set in the pipeline layout that will be updated. * @param pDescriptorWrites a pointer to an array of {@link VkWriteDescriptorSet} structures describing the descriptors to be updated. */ public static void vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, @NativeType("VkPipelineBindPoint") int pipelineBindPoint, @NativeType("VkPipelineLayout") long layout, @NativeType("uint32_t") int set, @NativeType("const VkWriteDescriptorSet *") VkWriteDescriptorSet.Buffer pDescriptorWrites) { nvkCmdPushDescriptorSetKHR(commandBuffer, pipelineBindPoint, layout, set, pDescriptorWrites.remaining(), pDescriptorWrites.address()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy