Class SpvcReflectedBuiltinResource
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.spvc.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.NativeResourceLayout
struct spvc_reflected_builtin_resource { SpvBuiltInbuiltin(); spvc_type_idvalue_type_id();spvc_reflected_resourceresource(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpvcReflectedBuiltinResource.BufferAn array ofSpvcReflectedBuiltinResourcestructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBUILTIN
RESOURCEThe struct member offsets.static intSIZEOFThe struct size in bytes.static intVALUE_TYPE_IDThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description SpvcReflectedBuiltinResource(java.nio.ByteBuffer container)Creates aSpvcReflectedBuiltinResourceinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intbuiltin()This is mostly here to support reflection of builtins such asPosition/PointSize/CullDistance/ClipDistance.SpvcReflectedBuiltinResourcebuiltin(int value)Sets the specified value to thebuiltin()field.static SpvcReflectedBuiltinResourcecalloc()Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemCalloc.static SpvcReflectedBuiltinResource.Buffercalloc(int capacity)Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemCalloc.static SpvcReflectedBuiltinResource.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SpvcReflectedBuiltinResourcecalloc(org.lwjgl.system.MemoryStack stack)Returns a newSpvcReflectedBuiltinResourceinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SpvcReflectedBuiltinResourcecreate()Returns a newSpvcReflectedBuiltinResourceinstance allocated withBufferUtils.static SpvcReflectedBuiltinResource.Buffercreate(int capacity)Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withBufferUtils.static SpvcReflectedBuiltinResourcecreate(long address)Returns a newSpvcReflectedBuiltinResourceinstance for the specified memory address.static SpvcReflectedBuiltinResource.Buffercreate(long address, int capacity)Create aSpvcReflectedBuiltinResource.Bufferinstance at the specified memory.static SpvcReflectedBuiltinResourcecreateSafe(long address)static SpvcReflectedBuiltinResource.BuffercreateSafe(long address, int capacity)static SpvcReflectedBuiltinResourcemalloc()Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemAlloc.static SpvcReflectedBuiltinResource.Buffermalloc(int capacity)Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemAlloc.static SpvcReflectedBuiltinResource.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated on the specifiedMemoryStack.static SpvcReflectedBuiltinResourcemalloc(org.lwjgl.system.MemoryStack stack)Returns a newSpvcReflectedBuiltinResourceinstance allocated on the specifiedMemoryStack.static intnbuiltin(long struct)Unsafe version ofbuiltin().static voidnbuiltin(long struct, int value)Unsafe version ofbuiltin.static SpvcReflectedResourcenresource(long struct)Unsafe version ofresource().static voidnresource(long struct, SpvcReflectedResource value)Unsafe version ofresource.static intnvalue_type_id(long struct)Unsafe version ofvalue_type_id().static voidnvalue_type_id(long struct, int value)Unsafe version ofvalue_type_id.SpvcReflectedResourceresource()This refers to the base resource which contains the builtin.SpvcReflectedBuiltinResourceresource(java.util.function.Consumer<SpvcReflectedResource> consumer)Passes theresource()field to the specifiedConsumer.SpvcReflectedBuiltinResourceresource(SpvcReflectedResource value)Copies the specifiedSpvcReflectedResourceto theresource()field.SpvcReflectedBuiltinResourceset(int builtin, int value_type_id, SpvcReflectedResource resource)Initializes this struct with the specified values.SpvcReflectedBuiltinResourceset(SpvcReflectedBuiltinResource src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.intvalue_type_id()This is the actual value type of the builtin.SpvcReflectedBuiltinResourcevalue_type_id(int value)Sets the specified value to thevalue_type_id()field.
-
-
-
Constructor Detail
-
SpvcReflectedBuiltinResource
public SpvcReflectedBuiltinResource(java.nio.ByteBuffer container)
Creates aSpvcReflectedBuiltinResourceinstance 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
-
builtin
public int builtin()
This is mostly here to support reflection of builtins such asPosition/PointSize/CullDistance/ClipDistance.This needs to be different from
Resourcesince 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 onOpVariablelevel, notBlockmembers. For that,compiler_update_active_builtins->compiler_has_active_builtincan 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 thegl_PerVertexbuiltins. 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_idcan be deduced, it's just more convenient this way.
-
builtin
public SpvcReflectedBuiltinResource builtin(int value)
Sets the specified value to thebuiltin()field.
-
value_type_id
public SpvcReflectedBuiltinResource value_type_id(int value)
Sets the specified value to thevalue_type_id()field.
-
resource
public SpvcReflectedBuiltinResource resource(SpvcReflectedResource value)
Copies the specifiedSpvcReflectedResourceto theresource()field.
-
resource
public SpvcReflectedBuiltinResource resource(java.util.function.Consumer<SpvcReflectedResource> consumer)
Passes theresource()field to the specifiedConsumer.
-
set
public SpvcReflectedBuiltinResource set(int builtin, int value_type_id, SpvcReflectedResource resource)
Initializes this struct with the specified values.
-
set
public SpvcReflectedBuiltinResource set(SpvcReflectedBuiltinResource src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static SpvcReflectedBuiltinResource malloc()
Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static SpvcReflectedBuiltinResource calloc()
Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static SpvcReflectedBuiltinResource create()
Returns a newSpvcReflectedBuiltinResourceinstance allocated withBufferUtils.
-
create
public static SpvcReflectedBuiltinResource create(long address)
Returns a newSpvcReflectedBuiltinResourceinstance for the specified memory address.
-
createSafe
@Nullable public static SpvcReflectedBuiltinResource createSafe(long address)
-
malloc
public static SpvcReflectedBuiltinResource.Buffer malloc(int capacity)
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static SpvcReflectedBuiltinResource.Buffer calloc(int capacity)
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static SpvcReflectedBuiltinResource.Buffer create(int capacity)
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static SpvcReflectedBuiltinResource.Buffer create(long address, int capacity)
Create aSpvcReflectedBuiltinResource.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static SpvcReflectedBuiltinResource.Buffer createSafe(long address, int capacity)
-
malloc
public static SpvcReflectedBuiltinResource malloc(org.lwjgl.system.MemoryStack stack)
Returns a newSpvcReflectedBuiltinResourceinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static SpvcReflectedBuiltinResource calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSpvcReflectedBuiltinResourceinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static SpvcReflectedBuiltinResource.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static SpvcReflectedBuiltinResource.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nbuiltin
public static int nbuiltin(long struct)
Unsafe version ofbuiltin().
-
nvalue_type_id
public static int nvalue_type_id(long struct)
Unsafe version ofvalue_type_id().
-
nresource
public static SpvcReflectedResource nresource(long struct)
Unsafe version ofresource().
-
nbuiltin
public static void nbuiltin(long struct, int value)Unsafe version ofbuiltin.
-
nvalue_type_id
public static void nvalue_type_id(long struct, int value)Unsafe version ofvalue_type_id.
-
nresource
public static void nresource(long struct, SpvcReflectedResource value)Unsafe version ofresource.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-