An unpack source generator is used to generate shader source code to unpack data from the data store buffer into a GLSL struct.
More...
#include <unpack_source_generator.hpp>
|
| UnpackSourceGenerator (c_string type_name) |
|
| UnpackSourceGenerator (c_array< const c_string > type_names) |
|
| UnpackSourceGenerator (const UnpackSourceGenerator &obj) |
|
UnpackSourceGenerator & | operator= (const UnpackSourceGenerator &rhs) |
|
UnpackSourceGenerator & | set (unsigned int offset, c_string field_name, type_t type, enum cast_t cast, unsigned int struct_idx=0) |
|
UnpackSourceGenerator & | set (unsigned int offset, unsigned int bit0, unsigned int num_bits, c_string field_name, type_t type, enum cast_t cast, unsigned int struct_idx=0) |
|
UnpackSourceGenerator & | set_float (unsigned int offset, c_string field_name, unsigned int struct_idx=0) |
|
UnpackSourceGenerator & | set_int (unsigned int offset, c_string field_name, unsigned int struct_idx=0) |
|
UnpackSourceGenerator & | set_uint (unsigned int offset, c_string field_name, unsigned int struct_idx=0) |
|
const UnpackSourceGenerator & | stream_unpack_function (ShaderSource &str, c_string function_name) const |
|
ShaderSource | stream_unpack_function (c_string function_name) const |
|
const UnpackSourceGenerator & | stream_unpack_size_function (ShaderSource &str, c_string function_name) const |
|
ShaderSource | stream_unpack_size_function (c_string function_name) const |
|
void | swap (UnpackSourceGenerator &obj) |
|
An unpack source generator is used to generate shader source code to unpack data from the data store buffer into a GLSL struct.
Definition at line 37 of file unpack_source_generator.hpp.
◆ cast_t
Enumeration specifying to bit-cast with GLSL's built-in uintBitsToFloat() or not
Enumerator |
---|
reinterpret_to_float_bits | Reinterpret the bits as float bits, i.e. use uintBitsToFloat() of GLSL
|
type_cast | only type-cast the bits.
|
Definition at line 61 of file unpack_source_generator.hpp.
◆ type_t
Enumeration specifing GLSL type for field (or subfield) of a value to unpack.
Enumerator |
---|
float_type | GLSL type is float
|
uint_type | GLSL type is uint
|
int_type | GLSL type is int
|
padding_type | indicates that the offset corresponds to padding and not any field or data.
|
Definition at line 44 of file unpack_source_generator.hpp.
◆ UnpackSourceGenerator() [1/3]
fastuidraw::glsl::UnpackSourceGenerator::UnpackSourceGenerator |
( |
c_string |
type_name | ) |
|
|
explicit |
Ctor.
- Parameters
-
type_name | name of GLSL type to which to unpack data from the data store buffer |
◆ UnpackSourceGenerator() [2/3]
fastuidraw::glsl::UnpackSourceGenerator::UnpackSourceGenerator |
( |
c_array< const c_string > |
type_names | ) |
|
|
explicit |
Ctor.
- Parameters
-
type_names | names of GLSL type to which to unpack data from the data store buffer |
◆ UnpackSourceGenerator() [3/3]
Copy ctor.
- Parameters
-
obj | value from which to copy values. |
◆ operator=()
◆ set() [1/2]
Set the field name that corresponds to an offset
- Parameters
-
offset | offset from the start of the packed struct in units of uint32_t |
field_name | GLSL name of the field to which to unpack the single scalar value. The value must include the dot if it is a field member of a struct. |
type | the GLSL type of the field |
cast | how to interpret the bits of the value |
struct_idx | if the ctor was given an array of c_string values, refers to the index into that array of the values. |
◆ set() [2/2]
UnpackSourceGenerator& fastuidraw::glsl::UnpackSourceGenerator::set |
( |
unsigned int |
offset, |
|
|
unsigned int |
bit0, |
|
|
unsigned int |
num_bits, |
|
|
c_string |
field_name, |
|
|
type_t |
type, |
|
|
enum cast_t |
cast, |
|
|
unsigned int |
struct_idx = 0 |
|
) |
| |
Set the field name that corresponds to an offset and range of bits within the value at the named offset
- Parameters
-
offset | offset from the start of the packed struct in units of uint32_t |
bit0 | first bit of field value storted at offset |
num_bits | number of bits used to store value. |
field_name | GLSL name of the field to which to unpack the single scalar value. The value must include the dot if it is a field member of a struct. |
type | the GLSL type of the field, must be uint_type or int_type |
cast | how to interpret the bits of the value |
struct_idx | if the ctor was given an array of c_string values, refers to the index into that array of the values. |
◆ set_float()
UnpackSourceGenerator& fastuidraw::glsl::UnpackSourceGenerator::set_float |
( |
unsigned int |
offset, |
|
|
c_string |
field_name, |
|
|
unsigned int |
struct_idx = 0 |
|
) |
| |
|
inline |
Provided as a conveniance, equivalent to
- Parameters
-
offset | offset from the start of the packed struct in units of uint32_t |
field_name | GLSL name of the field to which to unpack the single scalar value. The value must include the dot if it is a field member of a struct. |
struct_idx | if the ctor was given an array of c_string values, refers to the index into that array of the values. |
Definition at line 170 of file unpack_source_generator.hpp.
◆ set_int()
UnpackSourceGenerator& fastuidraw::glsl::UnpackSourceGenerator::set_int |
( |
unsigned int |
offset, |
|
|
c_string |
field_name, |
|
|
unsigned int |
struct_idx = 0 |
|
) |
| |
|
inline |
Provided as a conveniance, equivalent to
- Parameters
-
offset | offset from the start of the packed struct in units of uint32_t |
field_name | GLSL name of the field to which to unpack the single scalar value. The value must include the dot if it is a field member of a struct. |
struct_idx | if the ctor was given an array of c_string values, refers to the index into that array of the values. |
Definition at line 214 of file unpack_source_generator.hpp.
◆ set_uint()
UnpackSourceGenerator& fastuidraw::glsl::UnpackSourceGenerator::set_uint |
( |
unsigned int |
offset, |
|
|
c_string |
field_name, |
|
|
unsigned int |
struct_idx = 0 |
|
) |
| |
|
inline |
Provided as a conveniance, equivalent to
- Parameters
-
offset | offset from the start of the packed struct in units of uint32_t |
field_name | GLSL name of the field to which to unpack the single scalar value. The value must include the dot if it is a field member of a struct. |
struct_idx | if the ctor was given an array of c_string values, refers to the index into that array of the values. |
Definition at line 192 of file unpack_source_generator.hpp.
◆ stream_unpack_function() [1/2]
Stream the unpack function into a ShaderSource object. For values constructed passed a single c_string, the function generated is
void
function_name(in uint location, out struct_name v)
and for those values constructed passed an array of c_string values, the function generated is
void
function_name(in uint location, out struct_name0 v0, out struct_name1 v1, ...)
where for both, location is the location from which to unpack data and the remaining arguments are the struct types to which to unpacked as passed in the ctor.
- Parameters
-
str | ShaderSource to which to stream the unpack function |
function_name | name to give the function |
◆ stream_unpack_function() [2/2]
ShaderSource fastuidraw::glsl::UnpackSourceGenerator::stream_unpack_function |
( |
c_string |
function_name | ) |
const |
|
inline |
Provided as a conveniance, equivalent to
ShaderSource return_value;
return return_value;
- Parameters
-
function_name | to give the function |
Definition at line 266 of file unpack_source_generator.hpp.
◆ stream_unpack_size_function() [1/2]
Stream a function with the given name that returns the number of data blocks (i.e. the number of uvec4 elements) used to store the struct described by this UnpackSourceGenerator.
- Parameters
-
str | ShaderSource to which to stream the unpack function |
function_name | name to give the function |
◆ stream_unpack_size_function() [2/2]
ShaderSource fastuidraw::glsl::UnpackSourceGenerator::stream_unpack_size_function |
( |
c_string |
function_name | ) |
const |
|
inline |
Provided as a conveniance, equivalent to
ShaderSource return_value;
return return_value;
- Parameters
-
function_name | to give the function |
Definition at line 283 of file unpack_source_generator.hpp.
◆ swap()
Swap operation
- Parameters
-
obj | object with which to swap |
The documentation for this class was generated from the following file: