cgv
Loading...
Searching...
No Matches
cgv::render::program_variable_info Struct Reference

structure to store information on a shader program variable, i.e. More...

#include <context.h>

Public Member Functions

void compute_sizes (size_t &cnt, size_t &s, size_t &S) const
 helper member function to compute counts and sizes
 

Public Attributes

std::string name
 name as it appears in shaders
 
cgv::render::type_descriptor type_descr
 type descriptor providing information on component and compositions (scalar, vector or matrix)
 
unsigned array_size = 0
 dimension of arrays
 
int program_location
 location in program, but not for array variables which span multiple locations
 
std::vector< char > current_value
 data storage for the value of the program variable
 

Friends

CGV_API std::ostream & operator<< (std::ostream &os, const program_variable_info &V)
 operator to stream out program variable info in text format
 

Detailed Description

structure to store information on a shader program variable, i.e.

a uniform or attribute

Definition at line 95 of file context.h.

Member Function Documentation

◆ compute_sizes()

void cgv::render::program_variable_info::compute_sizes ( size_t cnt,
size_t s,
size_t S 
) const

helper member function to compute counts and sizes

Parameters
cntreference to variable retrieving component count
sreference to variable retrieving array element size in bytes
Sreference to variable retrieving total array size in bytes

Definition at line 61 of file context.cxx.

References array_size, cgv::type::info::get_type_size(), cgv::type::info::TI_BOOL, and type_descr.

Friends And Related Symbol Documentation

◆ operator<<

CGV_API std::ostream & operator<< ( std::ostream &  os,
const program_variable_info V 
)
friend

operator to stream out program variable info in text format

Definition at line 76 of file context.cxx.

Member Data Documentation

◆ array_size

unsigned cgv::render::program_variable_info::array_size = 0

dimension of arrays

Definition at line 102 of file context.h.

Referenced by compute_sizes().

◆ current_value

std::vector<char> cgv::render::program_variable_info::current_value

data storage for the value of the program variable

Definition at line 106 of file context.h.

◆ name

std::string cgv::render::program_variable_info::name

name as it appears in shaders

Definition at line 98 of file context.h.

◆ program_location

int cgv::render::program_variable_info::program_location

location in program, but not for array variables which span multiple locations

Definition at line 104 of file context.h.

◆ type_descr

cgv::render::type_descriptor cgv::render::program_variable_info::type_descr

type descriptor providing information on component and compositions (scalar, vector or matrix)

Definition at line 100 of file context.h.

Referenced by compute_sizes().


The documentation for this struct was generated from the following files: