Package org.lwjgl.util.spvc
Class SpvcMslResourceBinding
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.spvc.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.NativeResourceMatches the binding index of a MSL resource for a binding within a descriptor set.Taken together, the
stage,desc_setandbindingcombine 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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpvcMslResourceBinding.BufferAn array ofSpvcMslResourceBindingstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBINDING
DESC_SET
MSL_BUFFER
MSL_SAMPLER
MSL_TEXTUREThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSTAGEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description SpvcMslResourceBinding(java.nio.ByteBuffer container)Creates aSpvcMslResourceBindinginstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbinding()SpvcMslResourceBindingbinding(int value)Sets the specified value to thebindingfield.static SpvcMslResourceBindingcalloc()Returns a newSpvcMslResourceBindinginstance allocated withmemCalloc.static SpvcMslResourceBinding.Buffercalloc(int capacity)Returns a newSpvcMslResourceBinding.Bufferinstance allocated withmemCalloc.static SpvcMslResourceBinding.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSpvcMslResourceBinding.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SpvcMslResourceBindingcalloc(org.lwjgl.system.MemoryStack stack)Returns a newSpvcMslResourceBindinginstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SpvcMslResourceBindingcreate()Returns a newSpvcMslResourceBindinginstance allocated withBufferUtils.static SpvcMslResourceBinding.Buffercreate(int capacity)Returns a newSpvcMslResourceBinding.Bufferinstance allocated withBufferUtils.static SpvcMslResourceBindingcreate(long address)Returns a newSpvcMslResourceBindinginstance for the specified memory address.static SpvcMslResourceBinding.Buffercreate(long address, int capacity)Create aSpvcMslResourceBinding.Bufferinstance at the specified memory.static SpvcMslResourceBindingcreateSafe(long address)static SpvcMslResourceBinding.BuffercreateSafe(long address, int capacity)intdesc_set()SpvcMslResourceBindingdesc_set(int value)Sets the specified value to thedesc_setfield.static SpvcMslResourceBindingmalloc()Returns a newSpvcMslResourceBindinginstance allocated withmemAlloc.static SpvcMslResourceBinding.Buffermalloc(int capacity)Returns a newSpvcMslResourceBinding.Bufferinstance allocated withmemAlloc.static SpvcMslResourceBinding.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSpvcMslResourceBinding.Bufferinstance allocated on the specifiedMemoryStack.static SpvcMslResourceBindingmalloc(org.lwjgl.system.MemoryStack stack)Returns a newSpvcMslResourceBindinginstance allocated on the specifiedMemoryStack.intmsl_buffer()SpvcMslResourceBindingmsl_buffer(int value)Sets the specified value to themsl_bufferfield.intmsl_sampler()SpvcMslResourceBindingmsl_sampler(int value)Sets the specified value to themsl_samplerfield.intmsl_texture()SpvcMslResourceBindingmsl_texture(int value)Sets the specified value to themsl_texturefield.static intnbinding(long struct)Unsafe version ofbinding().static voidnbinding(long struct, int value)Unsafe version ofbinding.static intndesc_set(long struct)Unsafe version ofdesc_set().static voidndesc_set(long struct, int value)Unsafe version ofdesc_set.static intnmsl_buffer(long struct)Unsafe version ofmsl_buffer().static voidnmsl_buffer(long struct, int value)Unsafe version ofmsl_buffer.static intnmsl_sampler(long struct)Unsafe version ofmsl_sampler().static voidnmsl_sampler(long struct, int value)Unsafe version ofmsl_sampler.static intnmsl_texture(long struct)Unsafe version ofmsl_texture().static voidnmsl_texture(long struct, int value)Unsafe version ofmsl_texture.static intnstage(long struct)Unsafe version ofstage().static voidnstage(long struct, int value)Unsafe version ofstage.SpvcMslResourceBindingset(int stage, int desc_set, int binding, int msl_buffer, int msl_texture, int msl_sampler)Initializes this struct with the specified values.SpvcMslResourceBindingset(SpvcMslResourceBinding src)Copies the specified struct data to this struct.intsizeof()intstage()SpvcMslResourceBindingstage(int value)Sets the specified value to thestagefield.
-
-
-
Constructor Detail
-
SpvcMslResourceBinding
public SpvcMslResourceBinding(java.nio.ByteBuffer container)
Creates aSpvcMslResourceBindinginstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
stage
public int stage()
- Returns:
- the value of the
stagefield.
-
desc_set
public int desc_set()
- Returns:
- the value of the
desc_setfield.
-
binding
public int binding()
- Returns:
- the value of the
bindingfield.
-
msl_buffer
public int msl_buffer()
- Returns:
- the value of the
msl_bufferfield.
-
msl_texture
public int msl_texture()
- Returns:
- the value of the
msl_texturefield.
-
msl_sampler
public int msl_sampler()
- Returns:
- the value of the
msl_samplerfield.
-
stage
public SpvcMslResourceBinding stage(int value)
Sets the specified value to thestagefield.
-
desc_set
public SpvcMslResourceBinding desc_set(int value)
Sets the specified value to thedesc_setfield.
-
binding
public SpvcMslResourceBinding binding(int value)
Sets the specified value to thebindingfield.
-
msl_buffer
public SpvcMslResourceBinding msl_buffer(int value)
Sets the specified value to themsl_bufferfield.
-
msl_texture
public SpvcMslResourceBinding msl_texture(int value)
Sets the specified value to themsl_texturefield.
-
msl_sampler
public SpvcMslResourceBinding msl_sampler(int value)
Sets the specified value to themsl_samplerfield.
-
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.
-
set
public SpvcMslResourceBinding set(SpvcMslResourceBinding src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static SpvcMslResourceBinding malloc()
Returns a newSpvcMslResourceBindinginstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static SpvcMslResourceBinding calloc()
Returns a newSpvcMslResourceBindinginstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static SpvcMslResourceBinding create()
Returns a newSpvcMslResourceBindinginstance allocated withBufferUtils.
-
create
public static SpvcMslResourceBinding create(long address)
Returns a newSpvcMslResourceBindinginstance for the specified memory address.
-
createSafe
@Nullable public static SpvcMslResourceBinding createSafe(long address)
-
malloc
public static SpvcMslResourceBinding.Buffer malloc(int capacity)
Returns a newSpvcMslResourceBinding.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static SpvcMslResourceBinding.Buffer calloc(int capacity)
Returns a newSpvcMslResourceBinding.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static SpvcMslResourceBinding.Buffer create(int capacity)
Returns a newSpvcMslResourceBinding.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static SpvcMslResourceBinding.Buffer create(long address, int capacity)
Create aSpvcMslResourceBinding.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static SpvcMslResourceBinding.Buffer createSafe(long address, int capacity)
-
malloc
public static SpvcMslResourceBinding malloc(org.lwjgl.system.MemoryStack stack)
Returns a newSpvcMslResourceBindinginstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static SpvcMslResourceBinding calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSpvcMslResourceBindinginstance allocated on the specifiedMemoryStackand 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 newSpvcMslResourceBinding.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static SpvcMslResourceBinding.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSpvcMslResourceBinding.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nstage
public static int nstage(long struct)
Unsafe version ofstage().
-
ndesc_set
public static int ndesc_set(long struct)
Unsafe version ofdesc_set().
-
nbinding
public static int nbinding(long struct)
Unsafe version ofbinding().
-
nmsl_buffer
public static int nmsl_buffer(long struct)
Unsafe version ofmsl_buffer().
-
nmsl_texture
public static int nmsl_texture(long struct)
Unsafe version ofmsl_texture().
-
nmsl_sampler
public static int nmsl_sampler(long struct)
Unsafe version ofmsl_sampler().
-
nstage
public static void nstage(long struct, int value)Unsafe version ofstage.
-
ndesc_set
public static void ndesc_set(long struct, int value)Unsafe version ofdesc_set.
-
nbinding
public static void nbinding(long struct, int value)Unsafe version ofbinding.
-
nmsl_buffer
public static void nmsl_buffer(long struct, int value)Unsafe version ofmsl_buffer.
-
nmsl_texture
public static void nmsl_texture(long struct, int value)Unsafe version ofmsl_texture.
-
nmsl_sampler
public static void nmsl_sampler(long struct, int value)Unsafe version ofmsl_sampler.
-
-