Class SpvcReflectedBuiltinResource
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Layout
struct spvc_reflected_builtin_resource {
SpvBuiltIn builtin();
spvc_type_id value_type_id();
spvc_reflected_resource resource();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSpvcReflectedBuiltinResource(ByteBuffer container) Creates aSpvcReflectedBuiltinResourceinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionintbuiltin()This is mostly here to support reflection of builtins such asPosition/PointSize/CullDistance/ClipDistance.builtin(int value) Sets the specified value to thebuiltin()field.static SpvcReflectedBuiltinResourcecalloc()Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemCalloc.calloc(int capacity) Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemCalloc.calloc(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.create(int capacity) Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withBufferUtils.static SpvcReflectedBuiltinResourcecreate(long address) Returns a newSpvcReflectedBuiltinResourceinstance for the specified memory address.create(long address, int capacity) Create aSpvcReflectedBuiltinResource.Bufferinstance at the specified memory.static @Nullable SpvcReflectedBuiltinResourcecreateSafe(long address) static @Nullable SpvcReflectedBuiltinResource.BuffercreateSafe(long address, int capacity) static SpvcReflectedBuiltinResourcemalloc()Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemAlloc.malloc(int capacity) Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemAlloc.malloc(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.resource()This refers to the base resource which contains the builtin.resource(Consumer<SpvcReflectedResource> consumer) Passes theresource()field to the specifiedConsumer.resource(SpvcReflectedResource value) Copies the specifiedSpvcReflectedResourceto theresource()field.set(int builtin, int value_type_id, SpvcReflectedResource resource) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct) Validates pointer members that should not beNULL.intThis is the actual value type of the builtin.value_type_id(int value) Sets the specified value to thevalue_type_id()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
BUILTIN
public static final int BUILTINThe struct member offsets. -
VALUE_TYPE_ID
public static final int VALUE_TYPE_IDThe struct member offsets. -
RESOURCE
public static final int RESOURCEThe struct member offsets.
-
-
Constructor Details
-
SpvcReflectedBuiltinResource
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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<SpvcReflectedBuiltinResource>
-
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
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
Sets the specified value to thebuiltin()field. -
value_type_id
Sets the specified value to thevalue_type_id()field. -
resource
Copies the specifiedSpvcReflectedResourceto theresource()field. -
resource
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
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newSpvcReflectedBuiltinResourceinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newSpvcReflectedBuiltinResourceinstance allocated withBufferUtils. -
create
Returns a newSpvcReflectedBuiltinResourceinstance for the specified memory address. -
createSafe
-
malloc
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newSpvcReflectedBuiltinResource.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aSpvcReflectedBuiltinResource.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newSpvcReflectedBuiltinResourceinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
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:
capacity- the buffer capacitystack- the stack from which to allocate
-
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:
capacity- the buffer capacitystack- the stack from which to allocate
-
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
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
Unsafe version ofresource. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-