Class SpvcReflectedBuiltinResource

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

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

    Layout

    
     struct spvc_reflected_builtin_resource {
         SpvBuiltIn builtin();
         spvc_type_id value_type_id();
         spvc_reflected_resource resource();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • BUILTIN, VALUE_TYPE_ID, RESOURCE

        The struct member offsets.
    • Constructor Detail

      • SpvcReflectedBuiltinResource

        public SpvcReflectedBuiltinResource​(java.nio.ByteBuffer container)
        Creates a SpvcReflectedBuiltinResource 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
      • builtin

        public int builtin()
        This is mostly here to support reflection of builtins such as Position/PointSize/CullDistance/ClipDistance.

        This needs to be different from Resource since we can collect builtins from blocks. A builtin present here does not necessarily mean it's considered an active builtin, since variable ID "activeness" is only tracked on OpVariable level, not Block members. For that, compiler_update_active_builtins -> compiler_has_active_builtin can be used to further refine the reflection.

      • value_type_id

        public int value_type_id()
        This is the actual value type of the builtin.

        Typically float4, float, array<float, N> for the gl_PerVertex builtins. If the builtin is a control point, the control point array type will be stripped away here as appropriate.

      • resource

        public SpvcReflectedResource resource()
        This refers to the base resource which contains the builtin.

        If resource is a Block, it can hold multiple builtins, or it might not be a block. For advanced reflection scenarios, all information in builtin/value_type_id can be deduced, it's just more convenient this way.

      • malloc

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

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

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

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

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

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

        public static int nbuiltin​(long struct)
        Unsafe version of builtin().
      • nvalue_type_id

        public static int nvalue_type_id​(long struct)
        Unsafe version of value_type_id().
      • nbuiltin

        public static void nbuiltin​(long struct,
                                    int value)
        Unsafe version of builtin.
      • nvalue_type_id

        public static void nvalue_type_id​(long struct,
                                          int value)
        Unsafe version of value_type_id.
      • validate

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