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

org.lwjgl.vulkan.VkPipelineLayoutCreateInfo 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 java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * Structure specifying the parameters of a newly created pipeline layout object.
 * 
 * 
Valid Usage
* *
    *
  • {@code setLayoutCount} must be less than or equal to {@link VkPhysicalDeviceLimits}{@code ::maxBoundDescriptorSets}
  • *
  • The total number of descriptors of the type {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLER DESCRIPTOR_TYPE_SAMPLER} and {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER} accessible to any given shader stage across all elements of {@code pSetLayouts} must be less than or equal to {@link VkPhysicalDeviceLimits}{@code ::maxPerStageDescriptorSamplers}
  • *
  • The total number of descriptors of the type {@link VK10#VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER DESCRIPTOR_TYPE_UNIFORM_BUFFER} and {@link VK10#VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC} accessible to any given shader stage across all elements of {@code pSetLayouts} must be less than or equal to {@link VkPhysicalDeviceLimits}{@code ::maxPerStageDescriptorUniformBuffers}
  • *
  • The total number of descriptors of the type {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_BUFFER DESCRIPTOR_TYPE_STORAGE_BUFFER} and {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC} accessible to any given shader stage across all elements of {@code pSetLayouts} must be less than or equal to {@link VkPhysicalDeviceLimits}{@code ::maxPerStageDescriptorStorageBuffers}
  • *
  • The total number of descriptors of the type {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}, {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE DESCRIPTOR_TYPE_SAMPLED_IMAGE}, and {@link VK10#VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER} accessible to any given shader stage across all elements of {@code pSetLayouts} must be less than or equal to {@link VkPhysicalDeviceLimits}{@code ::maxPerStageDescriptorSampledImages}
  • *
  • The total number of descriptors of the type {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_IMAGE DESCRIPTOR_TYPE_STORAGE_IMAGE}, and {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER} accessible to any given shader stage across all elements of {@code pSetLayouts} must be less than or equal to {@link VkPhysicalDeviceLimits}{@code ::maxPerStageDescriptorStorageImages}
  • *
  • Any two elements of {@code pPushConstantRanges} must not include the same stage in {@code stageFlags}
  • *
  • {@code pSetLayouts} must not contain more than one descriptor set layout that was created with {@link KHRPushDescriptor#VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR} set
  • *
* *
Valid Usage (Implicit)
* *
    *
  • {@code sType} must be {@link VK10#VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}
  • *
  • {@code pNext} must be {@code NULL}
  • *
  • {@code flags} must be 0
  • *
  • If {@code setLayoutCount} is not 0, {@code pSetLayouts} must be a pointer to an array of {@code setLayoutCount} valid {@code VkDescriptorSetLayout} handles
  • *
  • If {@code pushConstantRangeCount} is not 0, {@code pPushConstantRanges} must be a pointer to an array of {@code pushConstantRangeCount} valid {@link VkPushConstantRange} structures
  • *
* *
See Also
* *

{@link VkPushConstantRange}, {@link VK10#vkCreatePipelineLayout CreatePipelineLayout}

* *

Member documentation

* *
    *
  • {@code sType} – the type of this structure.
  • *
  • {@code pNext} – {@code NULL} or a pointer to an extension-specific structure.
  • *
  • {@code flags} – reserved for future use.
  • *
  • {@code setLayoutCount} – the number of descriptor sets included in the pipeline layout.
  • *
  • {@code pSetLayouts} – a pointer to an array of {@code VkDescriptorSetLayout} objects.
  • *
  • {@code pushConstantRangeCount} – the number of push constant ranges included in the pipeline layout.
  • *
  • {@code pPushConstantRanges} – a pointer to an array of {@link VkPushConstantRange} structures defining a set of push constant ranges for use in a single pipeline layout. In addition to descriptor set layouts, a pipeline layout also describes how many push constants can be accessed by each stage of the pipeline. * *
    Note
    * *

    Push constants represent a high speed path to modify constant data in pipelines that is expected to outperform memory-backed resource updates.

    *
  • *
* *

Layout

* *
 * struct VkPipelineLayoutCreateInfo {
 *     VkStructureType sType;
 *     const void * pNext;
 *     VkPipelineLayoutCreateFlags flags;
 *     uint32_t setLayoutCount;
 *     const VkDescriptorSetLayout * pSetLayouts;
 *     uint32_t pushConstantRangeCount;
 *     const {@link VkPushConstantRange VkPushConstantRange} * pPushConstantRanges;
 * }
*/ public class VkPipelineLayoutCreateInfo extends Struct implements NativeResource { /** The struct size in bytes. */ public static final int SIZEOF; public static final int ALIGNOF; /** The struct member offsets. */ public static final int STYPE, PNEXT, FLAGS, SETLAYOUTCOUNT, PSETLAYOUTS, PUSHCONSTANTRANGECOUNT, PPUSHCONSTANTRANGES; static { Layout layout = __struct( __member(4), __member(POINTER_SIZE), __member(4), __member(4), __member(POINTER_SIZE), __member(4), __member(POINTER_SIZE) ); SIZEOF = layout.getSize(); ALIGNOF = layout.getAlignment(); STYPE = layout.offsetof(0); PNEXT = layout.offsetof(1); FLAGS = layout.offsetof(2); SETLAYOUTCOUNT = layout.offsetof(3); PSETLAYOUTS = layout.offsetof(4); PUSHCONSTANTRANGECOUNT = layout.offsetof(5); PPUSHCONSTANTRANGES = layout.offsetof(6); } VkPipelineLayoutCreateInfo(long address, ByteBuffer container) { super(address, container); } /** * Creates a {@link VkPipelineLayoutCreateInfo} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be * visible to the struct instance and vice versa. * *

The created instance holds a strong reference to the container object.

*/ public VkPipelineLayoutCreateInfo(ByteBuffer container) { this(memAddress(container), checkContainer(container, SIZEOF)); } @Override public int sizeof() { return SIZEOF; } /** Returns the value of the {@code sType} field. */ @NativeType("VkStructureType") public int sType() { return nsType(address()); } /** Returns the value of the {@code pNext} field. */ @NativeType("const void *") public long pNext() { return npNext(address()); } /** Returns the value of the {@code flags} field. */ @NativeType("VkPipelineLayoutCreateFlags") public int flags() { return nflags(address()); } /** Returns the value of the {@code setLayoutCount} field. */ @NativeType("uint32_t") public int setLayoutCount() { return nsetLayoutCount(address()); } /** Returns a {@link LongBuffer} view of the data pointed to by the {@code pSetLayouts} field. */ @NativeType("const VkDescriptorSetLayout *") public LongBuffer pSetLayouts() { return npSetLayouts(address()); } /** Returns the value of the {@code pushConstantRangeCount} field. */ @NativeType("uint32_t") public int pushConstantRangeCount() { return npushConstantRangeCount(address()); } /** Returns a {@link VkPushConstantRange.Buffer} view of the struct array pointed to by the {@code pPushConstantRanges} field. */ @NativeType("const VkPushConstantRange *") public VkPushConstantRange.Buffer pPushConstantRanges() { return npPushConstantRanges(address()); } /** Sets the specified value to the {@code sType} field. */ public VkPipelineLayoutCreateInfo sType(@NativeType("VkStructureType") int value) { nsType(address(), value); return this; } /** Sets the specified value to the {@code pNext} field. */ public VkPipelineLayoutCreateInfo pNext(@NativeType("const void *") long value) { npNext(address(), value); return this; } /** Sets the specified value to the {@code flags} field. */ public VkPipelineLayoutCreateInfo flags(@NativeType("VkPipelineLayoutCreateFlags") int value) { nflags(address(), value); return this; } /** Sets the address of the specified {@link LongBuffer} to the {@code pSetLayouts} field. */ public VkPipelineLayoutCreateInfo pSetLayouts(@NativeType("const VkDescriptorSetLayout *") LongBuffer value) { npSetLayouts(address(), value); return this; } /** Sets the address of the specified {@link VkPushConstantRange.Buffer} to the {@code pPushConstantRanges} field. */ public VkPipelineLayoutCreateInfo pPushConstantRanges(@NativeType("const VkPushConstantRange *") VkPushConstantRange.Buffer value) { npPushConstantRanges(address(), value); return this; } /** Initializes this struct with the specified values. */ public VkPipelineLayoutCreateInfo set( int sType, long pNext, int flags, LongBuffer pSetLayouts, VkPushConstantRange.Buffer pPushConstantRanges ) { sType(sType); pNext(pNext); flags(flags); pSetLayouts(pSetLayouts); pPushConstantRanges(pPushConstantRanges); return this; } /** * Copies the specified struct data to this struct. * * @param src the source struct * * @return this struct */ public VkPipelineLayoutCreateInfo set(VkPipelineLayoutCreateInfo src) { memCopy(src.address(), address(), SIZEOF); return this; } // ----------------------------------- /** Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ public static VkPipelineLayoutCreateInfo malloc() { return create(nmemAlloc(SIZEOF)); } /** Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ public static VkPipelineLayoutCreateInfo calloc() { return create(nmemCalloc(1, SIZEOF)); } /** Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated with {@link BufferUtils}. */ public static VkPipelineLayoutCreateInfo create() { return new VkPipelineLayoutCreateInfo(BufferUtils.createByteBuffer(SIZEOF)); } /** Returns a new {@link VkPipelineLayoutCreateInfo} instance for the specified memory address or {@code null} if the address is {@code NULL}. */ public static VkPipelineLayoutCreateInfo create(long address) { return address == NULL ? null : new VkPipelineLayoutCreateInfo(address, null); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. * * @param capacity the buffer capacity */ public static Buffer malloc(int capacity) { return create(__malloc(capacity, SIZEOF), capacity); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. * * @param capacity the buffer capacity */ public static Buffer calloc(int capacity) { return create(nmemCalloc(capacity, SIZEOF), capacity); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated with {@link BufferUtils}. * * @param capacity the buffer capacity */ public static Buffer create(int capacity) { return new Buffer(__create(capacity, SIZEOF)); } /** * Create a {@link VkPipelineLayoutCreateInfo.Buffer} instance at the specified memory. * * @param address the memory address * @param capacity the buffer capacity */ public static Buffer create(long address, int capacity) { return address == NULL ? null : new Buffer(address, null, -1, 0, capacity, capacity); } // ----------------------------------- /** Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated on the thread-local {@link MemoryStack}. */ public static VkPipelineLayoutCreateInfo mallocStack() { return mallocStack(stackGet()); } /** Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ public static VkPipelineLayoutCreateInfo callocStack() { return callocStack(stackGet()); } /** * Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated on the specified {@link MemoryStack}. * * @param stack the stack from which to allocate */ public static VkPipelineLayoutCreateInfo mallocStack(MemoryStack stack) { return create(stack.nmalloc(ALIGNOF, SIZEOF)); } /** * Returns a new {@link VkPipelineLayoutCreateInfo} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. * * @param stack the stack from which to allocate */ public static VkPipelineLayoutCreateInfo callocStack(MemoryStack stack) { return create(stack.ncalloc(ALIGNOF, 1, SIZEOF)); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated on the thread-local {@link MemoryStack}. * * @param capacity the buffer capacity */ public static Buffer mallocStack(int capacity) { return mallocStack(capacity, stackGet()); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. * * @param capacity the buffer capacity */ public static Buffer callocStack(int capacity) { return callocStack(capacity, stackGet()); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated on the specified {@link MemoryStack}. * * @param stack the stack from which to allocate * @param capacity the buffer capacity */ public static Buffer mallocStack(int capacity, MemoryStack stack) { return create(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); } /** * Returns a new {@link VkPipelineLayoutCreateInfo.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. * * @param stack the stack from which to allocate * @param capacity the buffer capacity */ public static Buffer callocStack(int capacity, MemoryStack stack) { return create(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); } // ----------------------------------- /** Unsafe version of {@link #sType}. */ public static int nsType(long struct) { return memGetInt(struct + VkPipelineLayoutCreateInfo.STYPE); } /** Unsafe version of {@link #pNext}. */ public static long npNext(long struct) { return memGetAddress(struct + VkPipelineLayoutCreateInfo.PNEXT); } /** Unsafe version of {@link #flags}. */ public static int nflags(long struct) { return memGetInt(struct + VkPipelineLayoutCreateInfo.FLAGS); } /** Unsafe version of {@link #setLayoutCount}. */ public static int nsetLayoutCount(long struct) { return memGetInt(struct + VkPipelineLayoutCreateInfo.SETLAYOUTCOUNT); } /** Unsafe version of {@link #pSetLayouts() pSetLayouts}. */ public static LongBuffer npSetLayouts(long struct) { return memLongBuffer(memGetAddress(struct + VkPipelineLayoutCreateInfo.PSETLAYOUTS), nsetLayoutCount(struct)); } /** Unsafe version of {@link #pushConstantRangeCount}. */ public static int npushConstantRangeCount(long struct) { return memGetInt(struct + VkPipelineLayoutCreateInfo.PUSHCONSTANTRANGECOUNT); } /** Unsafe version of {@link #pPushConstantRanges}. */ public static VkPushConstantRange.Buffer npPushConstantRanges(long struct) { return VkPushConstantRange.create(memGetAddress(struct + VkPipelineLayoutCreateInfo.PPUSHCONSTANTRANGES), npushConstantRangeCount(struct)); } /** Unsafe version of {@link #sType(int) sType}. */ public static void nsType(long struct, int value) { memPutInt(struct + VkPipelineLayoutCreateInfo.STYPE, value); } /** Unsafe version of {@link #pNext(long) pNext}. */ public static void npNext(long struct, long value) { memPutAddress(struct + VkPipelineLayoutCreateInfo.PNEXT, value); } /** Unsafe version of {@link #flags(int) flags}. */ public static void nflags(long struct, int value) { memPutInt(struct + VkPipelineLayoutCreateInfo.FLAGS, value); } /** Sets the specified value to the {@code setLayoutCount} field of the specified {@code struct}. */ public static void nsetLayoutCount(long struct, int value) { memPutInt(struct + VkPipelineLayoutCreateInfo.SETLAYOUTCOUNT, value); } /** Unsafe version of {@link #pSetLayouts(LongBuffer) pSetLayouts}. */ public static void npSetLayouts(long struct, LongBuffer value) { memPutAddress(struct + VkPipelineLayoutCreateInfo.PSETLAYOUTS, memAddressSafe(value)); nsetLayoutCount(struct, value == null ? 0 : value.remaining()); } /** Sets the specified value to the {@code pushConstantRangeCount} field of the specified {@code struct}. */ public static void npushConstantRangeCount(long struct, int value) { memPutInt(struct + VkPipelineLayoutCreateInfo.PUSHCONSTANTRANGECOUNT, value); } /** Unsafe version of {@link #pPushConstantRanges(VkPushConstantRange.Buffer) pPushConstantRanges}. */ public static void npPushConstantRanges(long struct, VkPushConstantRange.Buffer value) { memPutAddress(struct + VkPipelineLayoutCreateInfo.PPUSHCONSTANTRANGES, memAddressSafe(value)); npushConstantRangeCount(struct, value == null ? 0 : value.remaining()); } /** * Validates pointer members that should not be {@code NULL}. * * @param struct the struct to validate */ public static void validate(long struct) { if (nsetLayoutCount(struct) != 0) { check(memGetAddress(struct + VkPipelineLayoutCreateInfo.PSETLAYOUTS)); } if (npushConstantRangeCount(struct) != 0) { check(memGetAddress(struct + VkPipelineLayoutCreateInfo.PPUSHCONSTANTRANGES)); } } /** * Calls {@link #validate(long)} for each struct contained in the specified struct array. * * @param array the struct array to validate * @param count the number of structs in {@code array} */ public static void validate(long array, int count) { for (int i = 0; i < count; i++) { validate(array + i * SIZEOF); } } // ----------------------------------- /** An array of {@link VkPipelineLayoutCreateInfo} structs. */ public static class Buffer extends StructBuffer implements NativeResource { /** * Creates a new {@link VkPipelineLayoutCreateInfo.Buffer} instance backed by the specified container. * * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided * by {@link VkPipelineLayoutCreateInfo#SIZEOF}, and its mark will be undefined. * *

The created buffer instance holds a strong reference to the container object.

*/ public Buffer(ByteBuffer container) { super(container, container.remaining() / SIZEOF); } Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap) { super(address, container, mark, pos, lim, cap); } @Override protected Buffer self() { return this; } @Override protected Buffer newBufferInstance(long address, ByteBuffer container, int mark, int pos, int lim, int cap) { return new Buffer(address, container, mark, pos, lim, cap); } @Override protected VkPipelineLayoutCreateInfo newInstance(long address) { return new VkPipelineLayoutCreateInfo(address, container); } @Override public int sizeof() { return SIZEOF; } /** Returns the value of the {@code sType} field. */ @NativeType("VkStructureType") public int sType() { return VkPipelineLayoutCreateInfo.nsType(address()); } /** Returns the value of the {@code pNext} field. */ @NativeType("const void *") public long pNext() { return VkPipelineLayoutCreateInfo.npNext(address()); } /** Returns the value of the {@code flags} field. */ @NativeType("VkPipelineLayoutCreateFlags") public int flags() { return VkPipelineLayoutCreateInfo.nflags(address()); } /** Returns the value of the {@code setLayoutCount} field. */ @NativeType("uint32_t") public int setLayoutCount() { return VkPipelineLayoutCreateInfo.nsetLayoutCount(address()); } /** Returns a {@link LongBuffer} view of the data pointed to by the {@code pSetLayouts} field. */ @NativeType("const VkDescriptorSetLayout *") public LongBuffer pSetLayouts() { return VkPipelineLayoutCreateInfo.npSetLayouts(address()); } /** Returns the value of the {@code pushConstantRangeCount} field. */ @NativeType("uint32_t") public int pushConstantRangeCount() { return VkPipelineLayoutCreateInfo.npushConstantRangeCount(address()); } /** Returns a {@link VkPushConstantRange.Buffer} view of the struct array pointed to by the {@code pPushConstantRanges} field. */ @NativeType("const VkPushConstantRange *") public VkPushConstantRange.Buffer pPushConstantRanges() { return VkPipelineLayoutCreateInfo.npPushConstantRanges(address()); } /** Sets the specified value to the {@code sType} field. */ public VkPipelineLayoutCreateInfo.Buffer sType(@NativeType("VkStructureType") int value) { VkPipelineLayoutCreateInfo.nsType(address(), value); return this; } /** Sets the specified value to the {@code pNext} field. */ public VkPipelineLayoutCreateInfo.Buffer pNext(@NativeType("const void *") long value) { VkPipelineLayoutCreateInfo.npNext(address(), value); return this; } /** Sets the specified value to the {@code flags} field. */ public VkPipelineLayoutCreateInfo.Buffer flags(@NativeType("VkPipelineLayoutCreateFlags") int value) { VkPipelineLayoutCreateInfo.nflags(address(), value); return this; } /** Sets the address of the specified {@link LongBuffer} to the {@code pSetLayouts} field. */ public VkPipelineLayoutCreateInfo.Buffer pSetLayouts(@NativeType("const VkDescriptorSetLayout *") LongBuffer value) { VkPipelineLayoutCreateInfo.npSetLayouts(address(), value); return this; } /** Sets the address of the specified {@link VkPushConstantRange.Buffer} to the {@code pPushConstantRanges} field. */ public VkPipelineLayoutCreateInfo.Buffer pPushConstantRanges(@NativeType("const VkPushConstantRange *") VkPushConstantRange.Buffer value) { VkPipelineLayoutCreateInfo.npPushConstantRanges(address(), value); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy