Class SpvcReflectedResource

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<SpvcReflectedResource>
org.lwjgl.util.spvc.SpvcReflectedResource
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class SpvcReflectedResource extends org.lwjgl.system.Struct<SpvcReflectedResource> 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 Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • ID

      public static final int ID
      The struct member offsets.
    • BASE_TYPE_ID

      public static final int BASE_TYPE_ID
      The struct member offsets.
    • TYPE_ID

      public static final int TYPE_ID
      The struct member offsets.
    • NAME

      public static final int NAME
      The struct member offsets.
  • Constructor Details

    • SpvcReflectedResource

      public SpvcReflectedResource(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 Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<SpvcReflectedResource>
    • 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

      public ByteBuffer name()
      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.

    • nameString

      public 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.

    • id

      public SpvcReflectedResource id(int value)
      Sets the specified value to the id() field.
    • base_type_id

      public SpvcReflectedResource base_type_id(int value)
      Sets the specified value to the base_type_id() field.
    • type_id

      public SpvcReflectedResource type_id(int value)
      Sets the specified value to the type_id() field.
    • name

      public SpvcReflectedResource name(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, ByteBuffer name)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • 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

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

      public static SpvcReflectedResource.Buffer malloc(int capacity)
      Returns a new SpvcReflectedResource.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SpvcReflectedResource.Buffer calloc(int capacity)
      Returns a new SpvcReflectedResource.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SpvcReflectedResource.Buffer create(int capacity)
      Returns a new SpvcReflectedResource.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SpvcReflectedResource.Buffer create(long address, int capacity)
      Create a SpvcReflectedResource.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable SpvcReflectedResource.Buffer createSafe(long address, int capacity)
      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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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 ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static 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, 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