Uniform State

In order to construct a uniform block, Relinquish provides a API to query the shader about the size and content of each uniform block.

r_shader_uniform_location

uint r_shader_uniform_location(RShader *shader, char *name);

Description: Allows the application to query the location of a uniform value in a shader. Note that fis is a different location then the block offset

r_shader_uniform_texture_set

void r_shader_uniform_texture_set(RShader *shader, uint location, uint64 texture_id);

Description: Sets a texture address (obtained using r_shader_uniform_texture_pointer_get) in unifomr memory state

r_shader_mat2v_set

void r_shader_mat2v_set(RShader *shader, uint location, float *matrix);

Description: Sets a mat2 value in the uniform state.

r_shader_mat3v_set

void r_shader_mat3v_set(RShader *shader, uint location, float *matrix);

Description: Sets a mat3 value in the uniform state.

r_shader_mat4v_set

void r_shader_mat4v_set(RShader *shader, uint location, float *matrix);

Description: Sets a mat4 value in the uniform state.

r_shader_vec4_set

void r_shader_vec4_set(RShader *shader, uint location, float v0, float v1, float v2, float v3);

Description: Sets a vec4 value in the uniform state.

r_shader_vec3_set

void r_shader_vec3_set(RShader *shader, uint location, float v0, float v1, float v2);

Description: Sets a vec3 value in the uniform state.

r_shader_vec2_set

void r_shader_vec2_set(RShader *shader, uint location, float v0, float v1);

Description: Sets a vec2 value in the uniform state.

r_shader_float_set

void r_shader_float_set(RShader *shader, uint location, float f);

Description: Sets a float value in the uniform state.

r_shader_int_set

void r_shader_int_set(RShader *shader, uint location, int i);

Description: Sets a int value in the uniform state.

r_shader_int2_set

void r_shader_int2_set(RShader *shader, uint location, int i0, int i1);

Description: Sets a ivec2 value in the uniform state.

r_shader_int3_set

void r_shader_int3_set(RShader *shader, uint location, int i0, int i1, int i2);

Description: Sets a ivec3 value in the uniform state.

r_shader_int4_set

void r_shader_int4_set(RShader *shader, uint location, int i0, int i1, int i2, int i3);

Description: Sets a ivec4 value in the uniform state.

r_shader_input_fomat_components_get

uint *r_shader_input_fomat_components_get(RShader *s);

r_shader_input_fomat_count_get

uint r_shader_input_fomat_count_get(RShader *s);

r_shader_output_fomat_components_get

uint *r_shader_output_fomat_components_get(RShader *s);

r_shader_output_fomat_count_get

uint r_shader_output_fomat_count_get(RShader *s);