Class SpvcMslResourceBinding

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

    public class SpvcMslResourceBinding
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Matches the binding index of a MSL resource for a binding within a descriptor set.

    Taken together, the stage, desc_set and binding combine to form a reference to a resource descriptor used in a particular shading stage. If using MSL 2.0 argument buffers, the descriptor set is not marked as a discrete descriptor set, and (for iOS only) the resource is not a storage image (sampled != 2), the binding reference we remap to will become an [[id(N)]] attribute within the "descriptor set" argument buffer structure. For resources which are bound in the "classic" MSL 1.0 way or discrete descriptors, the remap will become a [[buffer(N)]], [[texture(N)]] or [[sampler(N)]] depending on the resource types used.

    Layout

    
     struct spvc_msl_resource_binding {
         SpvExecutionModel stage;
         unsigned int desc_set;
         unsigned int binding;
         unsigned int msl_buffer;
         unsigned int msl_texture;
         unsigned int msl_sampler;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STAGE, DESC_SET, BINDING, MSL_BUFFER, MSL_TEXTURE, MSL_SAMPLER

        The struct member offsets.
    • Constructor Detail

      • SpvcMslResourceBinding

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

        public int stage()
        Returns:
        the value of the stage field.
      • desc_set

        public int desc_set()
        Returns:
        the value of the desc_set field.
      • binding

        public int binding()
        Returns:
        the value of the binding field.
      • msl_buffer

        public int msl_buffer()
        Returns:
        the value of the msl_buffer field.
      • msl_texture

        public int msl_texture()
        Returns:
        the value of the msl_texture field.
      • msl_sampler

        public int msl_sampler()
        Returns:
        the value of the msl_sampler field.
      • desc_set

        public SpvcMslResourceBinding desc_set​(int value)
        Sets the specified value to the desc_set field.
      • binding

        public SpvcMslResourceBinding binding​(int value)
        Sets the specified value to the binding field.
      • msl_buffer

        public SpvcMslResourceBinding msl_buffer​(int value)
        Sets the specified value to the msl_buffer field.
      • msl_texture

        public SpvcMslResourceBinding msl_texture​(int value)
        Sets the specified value to the msl_texture field.
      • msl_sampler

        public SpvcMslResourceBinding msl_sampler​(int value)
        Sets the specified value to the msl_sampler field.
      • set

        public SpvcMslResourceBinding set​(int stage,
                                          int desc_set,
                                          int binding,
                                          int msl_buffer,
                                          int msl_texture,
                                          int msl_sampler)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

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

        public static SpvcMslResourceBinding.Buffer calloc​(int capacity,
                                                           org.lwjgl.system.MemoryStack stack)
        Returns a new SpvcMslResourceBinding.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
      • nstage

        public static int nstage​(long struct)
        Unsafe version of stage().
      • ndesc_set

        public static int ndesc_set​(long struct)
        Unsafe version of desc_set().
      • nbinding

        public static int nbinding​(long struct)
        Unsafe version of binding().
      • nmsl_buffer

        public static int nmsl_buffer​(long struct)
        Unsafe version of msl_buffer().
      • nmsl_texture

        public static int nmsl_texture​(long struct)
        Unsafe version of msl_texture().
      • nmsl_sampler

        public static int nmsl_sampler​(long struct)
        Unsafe version of msl_sampler().
      • nstage

        public static void nstage​(long struct,
                                  int value)
        Unsafe version of stage.
      • ndesc_set

        public static void ndesc_set​(long struct,
                                     int value)
        Unsafe version of desc_set.
      • nbinding

        public static void nbinding​(long struct,
                                    int value)
        Unsafe version of binding.
      • nmsl_buffer

        public static void nmsl_buffer​(long struct,
                                       int value)
        Unsafe version of msl_buffer.
      • nmsl_texture

        public static void nmsl_texture​(long struct,
                                        int value)
        Unsafe version of msl_texture.
      • nmsl_sampler

        public static void nmsl_sampler​(long struct,
                                        int value)
        Unsafe version of msl_sampler.