Class SpvcReflectedResource

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

    public class SpvcReflectedResource
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct spvc_reflected_resource {
         spvc_variable_id id();
         spvc_type_id base_type_id();
         spvc_type_id type_id();
         char const * name();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • ID, BASE_TYPE_ID, TYPE_ID, NAME

        The struct member offsets.
    • Constructor Detail

      • SpvcReflectedResource

        public SpvcReflectedResource​(java.nio.ByteBuffer container)
        Creates a SpvcReflectedResource 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • id

        public int id()
        Resources are identified with their SPIR-V ID. This is the ID of the OpVariable.
      • base_type_id

        public int base_type_id()
        The base type of the declared resource.

        This type is the base type which ignores pointers and arrays of the type_id. This is mostly useful to parse decorations of the underlying type. base_type_id can also be obtained with get_type(get_type(type_id).self).

      • type_id

        public int type_id()
        The type ID of the variable which includes arrays and all type modifications.

        This type ID is not suitable for parsing OpMemberDecoration of a struct and other decorations in general since these modifications typically happen on the base_type_id.

      • name, nameString

        public java.nio.ByteBuffer name()
        
        public java.lang.String nameString()
        
        The declared name (OpName) of the resource.

        For Buffer blocks, the name actually reflects the externally visible Block name. This name can be retrieved again by using either get_name(id) or get_name(base_type_id) depending if it's a buffer block or not. This name can be an empty string in which case get_fallback_name(id) can be used which obtains a suitable fallback identifier for an ID.

      • name

        public SpvcReflectedResource name​(java.nio.ByteBuffer value)
        Sets the address of the specified encoded string to the name() field.
      • set

        public SpvcReflectedResource set​(int id,
                                         int base_type_id,
                                         int type_id,
                                         java.nio.ByteBuffer name)
        Initializes this struct with the specified values.
      • malloc

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

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

        public static SpvcReflectedResource create()
        Returns a new SpvcReflectedResource instance allocated with BufferUtils.
      • create

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

        @Nullable
        public static SpvcReflectedResource createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static SpvcReflectedResource malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new SpvcReflectedResource instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static SpvcReflectedResource calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new SpvcReflectedResource instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static SpvcReflectedResource.Buffer malloc​(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new SpvcReflectedResource.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static SpvcReflectedResource.Buffer calloc​(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new SpvcReflectedResource.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nid

        public static int nid​(long struct)
        Unsafe version of id().
      • nbase_type_id

        public static int nbase_type_id​(long struct)
        Unsafe version of base_type_id().
      • ntype_id

        public static int ntype_id​(long struct)
        Unsafe version of type_id().
      • nname

        public static java.nio.ByteBuffer nname​(long struct)
        Unsafe version of name().
      • nnameString

        public static java.lang.String nnameString​(long struct)
        Unsafe version of nameString().
      • nid

        public static void nid​(long struct,
                               int value)
        Unsafe version of id.
      • nbase_type_id

        public static void nbase_type_id​(long struct,
                                         int value)
        Unsafe version of base_type_id.
      • ntype_id

        public static void ntype_id​(long struct,
                                    int value)
        Unsafe version of type_id.
      • nname

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

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