Class VkShaderModuleCreateInfo

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class VkShaderModuleCreateInfo
    extends Struct
    implements NativeResource
    Structure specifying parameters of a newly created shader module.
    Valid Usage
    • codeSize must be greater than 0
    • If pCode points to SPIR-V code, codeSize must be a multiple of 4
    • pCode must point to either valid SPIR-V code, formatted and packed as described by the Khronos SPIR-V Specification or valid GLSL code which must be written to the GL_KHR_vulkan_glsl extension specification
    • If pCode points to SPIR-V code, that code must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix
    • If pCode points to GLSL code, it must be valid GLSL code written to the GL_KHR_vulkan_glsl GLSL extension specification
    • pCode must declare the Shader capability for SPIR-V code
    • pCode must not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix
    • If pCode declares any of the capabilities listed as optional: in the SPIR-V Environment appendix, the corresponding feature(s) must be enabled.
    Valid Usage (Implicit)
    See Also

    CreateShaderModule

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • flags – reserved for future use.
    • codeSize – the size, in bytes, of the code pointed to by pCode.
    • pCode – points to code that is used to create the shader module

    Layout

    
     struct VkShaderModuleCreateInfo {
         VkStructureType sType;
         void const * pNext;
         VkShaderModuleCreateFlags flags;
         size_t codeSize;
         uint32_t const * pCode;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, FLAGS, CODESIZE, PCODE

        The struct member offsets.
    • Constructor Detail

      • VkShaderModuleCreateInfo

        public VkShaderModuleCreateInfo​(java.nio.ByteBuffer container)
        Creates a VkShaderModuleCreateInfo instance at the current position of the specified 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.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • sType

        public int sType()
        Returns the value of the sType field.
      • pNext

        public long pNext()
        Returns the value of the pNext field.
      • flags

        public int flags()
        Returns the value of the flags field.
      • codeSize

        public long codeSize()
        Returns the value of the codeSize field.
      • pCode

        public java.nio.ByteBuffer pCode()
        Returns a ByteBuffer view of the data pointed to by the pCode field.
      • pCode

        public VkShaderModuleCreateInfo pCode​(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the pCode field.
      • set

        public VkShaderModuleCreateInfo set​(int sType,
                                            long pNext,
                                            int flags,
                                            java.nio.ByteBuffer pCode)
        Initializes this struct with the specified values.
      • malloc

        public static VkShaderModuleCreateInfo malloc()
        Returns a new VkShaderModuleCreateInfo instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VkShaderModuleCreateInfo calloc()
        Returns a new VkShaderModuleCreateInfo instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VkShaderModuleCreateInfo create​(long address)
        Returns a new VkShaderModuleCreateInfo instance for the specified memory address.
      • callocStack

        public static VkShaderModuleCreateInfo callocStack()
        Returns a new VkShaderModuleCreateInfo instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static VkShaderModuleCreateInfo mallocStack​(MemoryStack stack)
        Returns a new VkShaderModuleCreateInfo instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkShaderModuleCreateInfo callocStack​(MemoryStack stack)
        Returns a new VkShaderModuleCreateInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nsType

        public static int nsType​(long struct)
        Unsafe version of sType().
      • npNext

        public static long npNext​(long struct)
        Unsafe version of pNext().
      • nflags

        public static int nflags​(long struct)
        Unsafe version of flags().
      • ncodeSize

        public static long ncodeSize​(long struct)
        Unsafe version of codeSize().
      • npCode

        public static java.nio.ByteBuffer npCode​(long struct)
        Unsafe version of pCode.
      • nsType

        public static void nsType​(long struct,
                                  int value)
        Unsafe version of sType.
      • npNext

        public static void npNext​(long struct,
                                  long value)
        Unsafe version of pNext.
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.
      • ncodeSize

        public static void ncodeSize​(long struct,
                                     long value)
        Sets the specified value to the codeSize field of the specified struct.
      • npCode

        public static void npCode​(long struct,
                                  java.nio.ByteBuffer value)
        Unsafe version of pCode.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array