<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GskGLShader">
<refmeta>
<refentrytitle role="top_of_page" id="GskGLShader.top_of_page">GskGLShader</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GSK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GskGLShader</refname>
<refpurpose>Fragment shaders for GSK</refpurpose>
</refnamediv>

<refsect1 id="GskGLShader.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GskGLShader"><returnvalue>GskGLShader</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-new-from-bytes">gsk_gl_shader_new_from_bytes</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GskGLShader"><returnvalue>GskGLShader</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-new-from-resource">gsk_gl_shader_new_from_resource</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-compile">gsk_gl_shader_compile</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-source">gsk_gl_shader_get_source</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-resource">gsk_gl_shader_get_resource</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-n-textures">gsk_gl_shader_get_n_textures</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-n-uniforms">gsk_gl_shader_get_n_uniforms</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-uniform-name">gsk_gl_shader_get_uniform_name</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-find-uniform-by-name">gsk_gl_shader_find_uniform_by_name</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GskGLUniformType"><returnvalue>GskGLUniformType</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-uniform-type">gsk_gl_shader_get_uniform_type</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-uniform-offset">gsk_gl_shader_get_uniform_offset</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gsize"><returnvalue>gsize</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-args-size">gsk_gl_shader_get_args_size</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="float"><returnvalue>float</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-float">gsk_gl_shader_get_arg_float</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint32"><returnvalue>gint32</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-int">gsk_gl_shader_get_arg_int</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint32"><returnvalue>guint32</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-uint">gsk_gl_shader_get_arg_uint</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-bool">gsk_gl_shader_get_arg_bool</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-vec2">gsk_gl_shader_get_arg_vec2</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-vec3">gsk_gl_shader_get_arg_vec3</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-gl-shader-get-arg-vec4">gsk_gl_shader_get_arg_vec4</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-format-args-va">gsk_gl_shader_format_args_va</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-gl-shader-format-args">gsk_gl_shader_format_args</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="function_type"><link linkend="GskShaderArgsBuilder"><returnvalue>GskShaderArgsBuilder</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-new">gsk_shader_args_builder_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-to-args">gsk_shader_args_builder_to_args</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-free-to-args">gsk_shader_args_builder_free_to_args</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-unref">gsk_shader_args_builder_unref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GskShaderArgsBuilder"><returnvalue>GskShaderArgsBuilder</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-ref">gsk_shader_args_builder_ref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-float">gsk_shader_args_builder_set_float</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-int">gsk_shader_args_builder_set_int</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-uint">gsk_shader_args_builder_set_uint</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-bool">gsk_shader_args_builder_set_bool</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-vec2">gsk_shader_args_builder_set_vec2</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-vec3">gsk_shader_args_builder_set_vec3</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gsk-shader-args-builder-set-vec4">gsk_shader_args_builder_set_vec4</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GskGLShader.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="char"><type>char</type></link>&#160;*</entry><entry role="property_name"><link linkend="GskGLShader--resource">resource</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>
<row><entry role="property_type"><link linkend="GBytes"><type>GBytes</type></link>&#160;*</entry><entry role="property_name"><link linkend="GskGLShader--source">source</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GskGLShader.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GskGLShader-struct">GskGLShader</link></entry></row>
<row><entry role="datatype_keyword">enum</entry><entry role="function_name"><link linkend="GskGLUniformType">GskGLUniformType</link></entry></row>


<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GskShaderArgsBuilder">GskShaderArgsBuilder</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GskGLShader.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GskGLShader
</screen>
</refsect1>


<refsect1 id="GskGLShader.description" role="desc">
<title role="desc.title">Description</title>
<para>A <link linkend="GskGLShader"><type>GskGLShader</type></link> is a snippet of GLSL that is meant to run in the
fragment shader of the rendering pipeline. A fragment shader
gets the coordinates being rendered as input and produces the
pixel values for that particular pixel. Additionally, the
shader can declare a set of other input arguments, called
uniforms (as they are uniform over all the calls to your shader in
each instance of use). A shader can also receive up to 4
textures that it can use as input when producing the pixel data.</para>
<para>  <link linkend="GskGLShader"><type>GskGLShader</type></link> is usually used with <link linkend="gtk-snapshot-push-gl-shader"><function>gtk_snapshot_push_gl_shader()</function></link>
to produce a <link linkend="GskGLShaderNode"><type>GskGLShaderNode</type></link> in the rendering hierarchy, and then
its input textures are constructed by rendering the child nodes to
textures before rendering the shader node itself. (You can pass
texture nodes as children if you want to directly use a texture
as input).</para>
<para>The actual shader code is GLSL code that gets combined with
some other code into the fragment shader. Since the exact
capabilities of the GPU driver differs between different OpenGL
drivers and hardware, GTK adds some defines that you can use
to ensure your GLSL code runs on as many drivers as it can.</para>
<para>If the OpenGL driver is GLES, then the shader language version
is set to 100, and GSK_GLES will be defined in the shader.</para>
<para>Otherwise, if the OpenGL driver does not support the 3.2 core profile,
then the shader will run with language version 110 for GL2 and 130 for GL3,
and GSK_LEGACY will be defined in the shader.</para>
<para>If the OpenGL driver supports the 3.2 code profile, it will be used,
the shader language version is set to 150, and GSK_GL3 will be defined
in the shader.</para>
<para>The main function the shader must implement is:</para>
<informalexample><programlisting role="example"><![CDATA[
 void mainImage(out vec4 fragColor,
                in vec2 fragCoord,
                in vec2 resolution,
                in vec2 uv)
]]></programlisting></informalexample>
<para></para>
<para>Where the input <parameter>fragCoord</parameter>
 is the coordinate of the pixel we're
currently rendering, relative to the boundary rectangle that was
specified in the <link linkend="GskGLShaderNode"><type>GskGLShaderNode</type></link>, and <parameter>resolution</parameter>
 is the width and
height of that rectangle. This is in the typical GTK coordinate
system with the origin in the top left. <parameter>uv</parameter>
 contains the u and v
coordinates that can be used to index a texture at the
corresponding point. These coordinates are in the [0..1]x[0..1]
region, with 0, 0 being in the lower left corder (which is typical
for OpenGL).</para>
<para>The output <parameter>fragColor</parameter>
 should be a RGBA color (with
premultiplied alpha) that will be used as the output for the
specified pixel location. Note that this output will be
automatically clipped to the clip region of the glshader node.</para>
<para>In addition to the function arguments the shader can define
up to 4 uniforms for textures which must be called u_textureN
(i.e. u_texture1 to u_texture4) as well as any custom uniforms
you want of types int, uint, bool, float, vec2, vec3 or vec4.</para>
<para>All textures sources contain premultiplied alpha colors, but if some
there are outer sources of colors there is a <link linkend="gsk-premultiply"><function>gsk_premultiply()</function></link> helper
to compute premultiplication when needed.</para>
<para>Note that GTK parses the uniform declarations, so each uniform has to
be on a line by itself with no other code, like so:</para>
<informalexample><programlisting role="example"><![CDATA[
uniform float u_time;
uniform vec3 u_color;
uniform sampler2D u_texture1;
uniform sampler2D u_texture2;
]]></programlisting></informalexample>
<para></para>
<para>GTK uses the the "gsk" namespace in the symbols it uses in the
shader, so your code should not use any symbols with the prefix gsk
or GSK. There are some helper functions declared that you can use:</para>
<informalexample><programlisting role="example"><![CDATA[
vec4 GskTexture(sampler2D sampler, vec2 texCoords);
]]></programlisting></informalexample>
<para></para>
<para>This samples a texture (e.g. u_texture1) at the specified
coordinates, and containes some helper ifdefs to ensure that
it works on all OpenGL versions.</para>
<para>You can compile the shader yourself using <link linkend="gsk-gl-shader-compile"><function>gsk_gl_shader_compile()</function></link>,
otherwise the GSK renderer will do it when it handling the glshader
node. If errors occurs, the returned <parameter>error</parameter>
 will include the glsl
sources, so you can see what GSK was passing to the compiler. You
can also set GSK_DEBUG=shaders in the environment to see the sources
and other relevant information about all shaders that GSK is handling.</para>
<refsect2><title>An example shader</title><informalexample><programlisting role="example"><![CDATA[
uniform float position;
uniform sampler2D u_texture1;
uniform sampler2D u_texture2;

void mainImage(out vec4 fragColor,
               in vec2 fragCoord,
               in vec2 resolution,
               in vec2 uv) {
  vec4 source1 = GskTexture(u_texture1, uv);
  vec4 source2 = GskTexture(u_texture2, uv);

  fragColor = position * source1 + (1.0 - position) * source2;
}
]]></programlisting></informalexample>
<para></para>
</refsect2>

</refsect1>
<refsect1 id="GskGLShader.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gsk-gl-shader-new-from-bytes" role="function">
<title>gsk_gl_shader_new_from_bytes&#160;()</title>
<indexterm zone="gsk-gl-shader-new-from-bytes"><primary>gsk_gl_shader_new_from_bytes</primary></indexterm>
<programlisting language="C"><link linkend="GskGLShader"><returnvalue>GskGLShader</returnvalue></link>&#160;*
gsk_gl_shader_new_from_bytes (<parameter><link linkend="GBytes"><type>GBytes</type></link> *sourcecode</parameter>);</programlisting>
<para>Creates a <link linkend="GskGLShader"><type>GskGLShader</type></link> that will render pixels using the specified code.</para>
<refsect3 id="gsk-gl-shader-new-from-bytes.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>sourcecode</para></entry>
<entry role="parameter_description"><para>GLSL sourcecode for the shader, as a <link linkend="GBytes"><type>GBytes</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-new-from-bytes.returns" role="returns">
<title>Returns</title>
<para>A new <link linkend="GskGLShader"><type>GskGLShader</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-new-from-resource" role="function">
<title>gsk_gl_shader_new_from_resource&#160;()</title>
<indexterm zone="gsk-gl-shader-new-from-resource"><primary>gsk_gl_shader_new_from_resource</primary></indexterm>
<programlisting language="C"><link linkend="GskGLShader"><returnvalue>GskGLShader</returnvalue></link>&#160;*
gsk_gl_shader_new_from_resource (<parameter>const <link linkend="char"><type>char</type></link> *resource_path</parameter>);</programlisting>
<para>Creates a <link linkend="GskGLShader"><type>GskGLShader</type></link> that will render pixels using the specified code.</para>
<refsect3 id="gsk-gl-shader-new-from-resource.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>resource_path</para></entry>
<entry role="parameter_description"><para>path to a resource that contains the GLSL sourcecode for
the shader</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-new-from-resource.returns" role="returns">
<title>Returns</title>
<para>A new <link linkend="GskGLShader"><type>GskGLShader</type></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-compile" role="function">
<title>gsk_gl_shader_compile&#160;()</title>
<indexterm zone="gsk-gl-shader-compile"><primary>gsk_gl_shader_compile</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gsk_gl_shader_compile (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                       <parameter><link linkend="GskRenderer"><type>GskRenderer</type></link> *renderer</parameter>,
                       <parameter><link linkend="GError"><type>GError</type></link> **error</parameter>);</programlisting>
<para>Tries to compile the <parameter>shader</parameter>
 for the given <parameter>renderer</parameter>
, and reports
<link linkend="FALSE:CAPS"><literal>FALSE</literal></link> with an error if there is a problem. You should use this
function before relying on the shader for rendering and use a
fallback with a simpler shader or without shaders if it fails.</para>
<para>Note that this will modify the rendering state (for example
change the current GL context) and requires the renderer to be
set up. This means that the widget has to be realized. Commonly you
want to call this from the realize signal of a widget, or during
widget snapshot.</para>
<refsect3 id="gsk-gl-shader-compile.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>renderer</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskRenderer"><type>GskRenderer</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>error</para></entry>
<entry role="parameter_description"><para>location to store error in</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-compile.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> on success, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if an error occurred</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-source" role="function">
<title>gsk_gl_shader_get_source&#160;()</title>
<indexterm zone="gsk-gl-shader-get-source"><primary>gsk_gl_shader_get_source</primary></indexterm>
<programlisting language="C"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
gsk_gl_shader_get_source (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>);</programlisting>
<para>Gets the GLSL sourcecode being used to render this shader.</para>
<refsect3 id="gsk-gl-shader-get-source.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-source.returns" role="returns">
<title>Returns</title>
<para>The source code for the shader. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-resource" role="function">
<title>gsk_gl_shader_get_resource&#160;()</title>
<indexterm zone="gsk-gl-shader-get-resource"><primary>gsk_gl_shader_get_resource</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
gsk_gl_shader_get_resource (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>);</programlisting>
<para>Gets the resource path for the GLSL sourcecode being used
to render this shader.</para>
<refsect3 id="gsk-gl-shader-get-resource.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-resource.returns" role="returns">
<title>Returns</title>
<para>The resource path for the shader,
or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-n-textures" role="function">
<title>gsk_gl_shader_get_n_textures&#160;()</title>
<indexterm zone="gsk-gl-shader-get-n-textures"><primary>gsk_gl_shader_get_n_textures</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gsk_gl_shader_get_n_textures (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>);</programlisting>
<para>Returns the number of textures that the shader requires.</para>
<para>This can be used to check that the a passed shader works
in your usecase. It is determined by looking at the highest
u_textureN value that the shader defines.</para>
<refsect3 id="gsk-gl-shader-get-n-textures.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-n-textures.returns" role="returns">
<title>Returns</title>
<para> The number of texture inputs required by <parameter>shader</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-n-uniforms" role="function">
<title>gsk_gl_shader_get_n_uniforms&#160;()</title>
<indexterm zone="gsk-gl-shader-get-n-uniforms"><primary>gsk_gl_shader_get_n_uniforms</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gsk_gl_shader_get_n_uniforms (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>);</programlisting>
<para>Get the number of declared uniforms for this shader.</para>
<refsect3 id="gsk-gl-shader-get-n-uniforms.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-n-uniforms.returns" role="returns">
<title>Returns</title>
<para> The number of declared uniforms</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-uniform-name" role="function">
<title>gsk_gl_shader_get_uniform_name&#160;()</title>
<indexterm zone="gsk-gl-shader-get-uniform-name"><primary>gsk_gl_shader_get_uniform_name</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
gsk_gl_shader_get_uniform_name (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                                <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Get the name of the declared uniform for this shader at index <parameter>idx</parameter>
.</para>
<refsect3 id="gsk-gl-shader-get-uniform-name.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-uniform-name.returns" role="returns">
<title>Returns</title>
<para>The name of the declared uniform. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-find-uniform-by-name" role="function">
<title>gsk_gl_shader_find_uniform_by_name&#160;()</title>
<indexterm zone="gsk-gl-shader-find-uniform-by-name"><primary>gsk_gl_shader_find_uniform_by_name</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gsk_gl_shader_find_uniform_by_name (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                                    <parameter>const <link linkend="char"><type>char</type></link> *name</parameter>);</programlisting>
<para>Looks for a uniform by the name <parameter>name</parameter>
, and returns the index
of the uniform, or -1 if it was not found.</para>
<refsect3 id="gsk-gl-shader-find-uniform-by-name.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>name</para></entry>
<entry role="parameter_description"><para>uniform name</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-find-uniform-by-name.returns" role="returns">
<title>Returns</title>
<para> The index of the uniform, or -1</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-uniform-type" role="function">
<title>gsk_gl_shader_get_uniform_type&#160;()</title>
<indexterm zone="gsk-gl-shader-get-uniform-type"><primary>gsk_gl_shader_get_uniform_type</primary></indexterm>
<programlisting language="C"><link linkend="GskGLUniformType"><returnvalue>GskGLUniformType</returnvalue></link>
gsk_gl_shader_get_uniform_type (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                                <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Get the type of the declared uniform for this shader at index <parameter>idx</parameter>
.</para>
<refsect3 id="gsk-gl-shader-get-uniform-type.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-uniform-type.returns" role="returns">
<title>Returns</title>
<para> The type of the declared uniform</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-uniform-offset" role="function">
<title>gsk_gl_shader_get_uniform_offset&#160;()</title>
<indexterm zone="gsk-gl-shader-get-uniform-offset"><primary>gsk_gl_shader_get_uniform_offset</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gsk_gl_shader_get_uniform_offset (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Get the offset into the data block where data for this uniforms is stored.</para>
<refsect3 id="gsk-gl-shader-get-uniform-offset.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-uniform-offset.returns" role="returns">
<title>Returns</title>
<para> The data offset</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-args-size" role="function">
<title>gsk_gl_shader_get_args_size&#160;()</title>
<indexterm zone="gsk-gl-shader-get-args-size"><primary>gsk_gl_shader_get_args_size</primary></indexterm>
<programlisting language="C"><link linkend="gsize"><returnvalue>gsize</returnvalue></link>
gsk_gl_shader_get_args_size (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>);</programlisting>
<para>Get the size of the data block used to specify arguments for this shader.</para>
<refsect3 id="gsk-gl-shader-get-args-size.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-args-size.returns" role="returns">
<title>Returns</title>
<para> The size of the data block</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-float" role="function">
<title>gsk_gl_shader_get_arg_float&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-float"><primary>gsk_gl_shader_get_arg_float</primary></indexterm>
<programlisting language="C"><link linkend="float"><returnvalue>float</returnvalue></link>
gsk_gl_shader_get_arg_float (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                             <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                             <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of float type.</para>
<refsect3 id="gsk-gl-shader-get-arg-float.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-arg-float.returns" role="returns">
<title>Returns</title>
<para> The value</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-int" role="function">
<title>gsk_gl_shader_get_arg_int&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-int"><primary>gsk_gl_shader_get_arg_int</primary></indexterm>
<programlisting language="C"><link linkend="gint32"><returnvalue>gint32</returnvalue></link>
gsk_gl_shader_get_arg_int (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                           <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                           <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of int type.</para>
<refsect3 id="gsk-gl-shader-get-arg-int.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-arg-int.returns" role="returns">
<title>Returns</title>
<para> The value</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-uint" role="function">
<title>gsk_gl_shader_get_arg_uint&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-uint"><primary>gsk_gl_shader_get_arg_uint</primary></indexterm>
<programlisting language="C"><link linkend="guint32"><returnvalue>guint32</returnvalue></link>
gsk_gl_shader_get_arg_uint (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                            <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of uint type.</para>
<refsect3 id="gsk-gl-shader-get-arg-uint.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-arg-uint.returns" role="returns">
<title>Returns</title>
<para> The value</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-bool" role="function">
<title>gsk_gl_shader_get_arg_bool&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-bool"><primary>gsk_gl_shader_get_arg_bool</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gsk_gl_shader_get_arg_bool (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                            <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> idx</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of bool type.</para>
<refsect3 id="gsk-gl-shader-get-arg-bool.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-get-arg-bool.returns" role="returns">
<title>Returns</title>
<para> The value</para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-vec2" role="function">
<title>gsk_gl_shader_get_arg_vec2&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-vec2"><primary>gsk_gl_shader_get_arg_vec2</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_gl_shader_get_arg_vec2 (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                            <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                            <parameter><link linkend="graphene-vec2-t"><type>graphene_vec2_t</type></link> *out_value</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of vec2 type.</para>
<refsect3 id="gsk-gl-shader-get-arg-vec2.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>out_value</para></entry>
<entry role="parameter_description"><para>location to store the uniform value in</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-vec3" role="function">
<title>gsk_gl_shader_get_arg_vec3&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-vec3"><primary>gsk_gl_shader_get_arg_vec3</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_gl_shader_get_arg_vec3 (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                            <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                            <parameter><link linkend="graphene-vec3-t"><type>graphene_vec3_t</type></link> *out_value</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of vec3 type.</para>
<refsect3 id="gsk-gl-shader-get-arg-vec3.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>out_value</para></entry>
<entry role="parameter_description"><para>location to store the uniform value in</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-get-arg-vec4" role="function">
<title>gsk_gl_shader_get_arg_vec4&#160;()</title>
<indexterm zone="gsk-gl-shader-get-arg-vec4"><primary>gsk_gl_shader_get_arg_vec4</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_gl_shader_get_arg_vec4 (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                            <parameter><link linkend="GBytes"><type>GBytes</type></link> *args</parameter>,
                            <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                            <parameter><link linkend="graphene-vec4-t"><type>graphene_vec4_t</type></link> *out_value</parameter>);</programlisting>
<para>Gets the value of the uniform <parameter>idx</parameter>
 in the <parameter>args</parameter>
 block.
The uniform must be of vec4 type.</para>
<refsect3 id="gsk-gl-shader-get-arg-vec4.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>args</para></entry>
<entry role="parameter_description"><para>uniform arguments</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>out_value</para></entry>
<entry role="parameter_description"><para>location to store set the uniform value in</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-format-args-va" role="function">
<title>gsk_gl_shader_format_args_va&#160;()</title>
<indexterm zone="gsk-gl-shader-format-args-va"><primary>gsk_gl_shader_format_args_va</primary></indexterm>
<programlisting language="C"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
gsk_gl_shader_format_args_va (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                              <parameter><link linkend="va-list"><type>va_list</type></link> uniforms</parameter>);</programlisting>
<para>Formats the uniform data as needed for feeding the named uniforms
values into the shader. The argument list is a list of pairs of
names, and values for the types that match the declared uniforms
(i.e. double/int/guint/gboolean for primitive values and
<literal>graphene_vecN_t *</literal> for vecN uniforms).</para>
<para>It is an error to pass a uniform name that is not declared by the shader.</para>
<para>Any uniforms of the shader that are not included in the argument list
are zero-initialized.</para>
<refsect3 id="gsk-gl-shader-format-args-va.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>uniforms</para></entry>
<entry role="parameter_description"><para>name-Value pairs for the uniforms of <parameter>shader</parameter>
, ending
with a <link linkend="NULL:CAPS"><literal>NULL</literal></link> name</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-format-args-va.returns" role="returns">
<title>Returns</title>
<para>A newly allocated block of data which can be
passed to <link linkend="gsk-gl-shader-node-new"><function>gsk_gl_shader_node_new()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-gl-shader-format-args" role="function">
<title>gsk_gl_shader_format_args&#160;()</title>
<indexterm zone="gsk-gl-shader-format-args"><primary>gsk_gl_shader_format_args</primary></indexterm>
<programlisting language="C"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
gsk_gl_shader_format_args (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                           <parameter>...</parameter>);</programlisting>
<para>Formats the uniform data as needed for feeding the named uniforms
values into the shader. The argument list is a list of pairs of
names, and values for the types that match the declared uniforms
(i.e. double/int/guint/gboolean for primitive values and
<literal>graphene_vecN_t *</literal> for vecN uniforms).</para>
<para>Any uniforms of the shader that are not included in the argument list
are zero-initialized.</para>
<refsect3 id="gsk-gl-shader-format-args.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>...</para></entry>
<entry role="parameter_description"><para>name-Value pairs for the uniforms of <parameter>shader</parameter>
, ending with
a <link linkend="NULL:CAPS"><literal>NULL</literal></link> name</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-gl-shader-format-args.returns" role="returns">
<title>Returns</title>
<para>A newly allocated block of data which can be
passed to <link linkend="gsk-gl-shader-node-new"><function>gsk_gl_shader_node_new()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-new" role="function">
<title>gsk_shader_args_builder_new&#160;()</title>
<indexterm zone="gsk-shader-args-builder-new"><primary>gsk_shader_args_builder_new</primary></indexterm>
<programlisting language="C"><link linkend="GskShaderArgsBuilder"><returnvalue>GskShaderArgsBuilder</returnvalue></link>&#160;*
gsk_shader_args_builder_new (<parameter><link linkend="GskGLShader"><type>GskGLShader</type></link> *shader</parameter>,
                             <parameter><link linkend="GBytes"><type>GBytes</type></link> *initial_values</parameter>);</programlisting>
<para>Allocates a builder that can be used to construct a new uniform data
chunk.</para>
<refsect3 id="gsk-shader-args-builder-new.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>shader</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskGLShader"><type>GskGLShader</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>initial_values</para></entry>
<entry role="parameter_description"><para>optional <link linkend="Bytes"><type>Bytes</type></link> with initial values. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-shader-args-builder-new.returns" role="returns">
<title>Returns</title>
<para>The newly allocated builder, free with
<link linkend="gsk-shader-args-builder-unref"><function>gsk_shader_args_builder_unref()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-to-args" role="function">
<title>gsk_shader_args_builder_to_args&#160;()</title>
<indexterm zone="gsk-shader-args-builder-to-args"><primary>gsk_shader_args_builder_to_args</primary></indexterm>
<programlisting language="C"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
gsk_shader_args_builder_to_args (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>);</programlisting>
<para>Creates a new <link linkend="GBytes"><type>GBytes</type></link> args from the current state of the
given <parameter>builder</parameter>
. Any uniforms of the shader that have not
been explicitly set on the <parameter>builder</parameter>
 are zero-initialized.</para>
<para>The given <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> is reset once this function returns;
you cannot call this function multiple times on the same <parameter>builder</parameter>
 instance.</para>
<para>This function is intended primarily for bindings. C code should use
<link linkend="gsk-shader-args-builder-free-to-args"><function>gsk_shader_args_builder_free_to_args()</function></link>.</para>
<refsect3 id="gsk-shader-args-builder-to-args.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-shader-args-builder-to-args.returns" role="returns">
<title>Returns</title>
<para>the newly allocated builder, free with
<link linkend="gsk-shader-args-builder-free"><function>gsk_shader_args_builder_free()</function></link>. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-free-to-args" role="function">
<title>gsk_shader_args_builder_free_to_args&#160;()</title>
<indexterm zone="gsk-shader-args-builder-free-to-args"><primary>gsk_shader_args_builder_free_to_args</primary></indexterm>
<programlisting language="C"><link linkend="GBytes"><returnvalue>GBytes</returnvalue></link>&#160;*
gsk_shader_args_builder_free_to_args (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>);</programlisting>
<para>Creates a new <link linkend="GBytes"><type>GBytes</type></link> args from the current state of the
given <parameter>builder</parameter>
, and frees the <parameter>builder</parameter>
 instance. Any uniforms
of the shader that have not been explicitly set on the <parameter>builder</parameter>

are zero-initialized.</para>

<para><emphasis role="annotation">[<acronym>skip</acronym>]</emphasis></para><refsect3 id="gsk-shader-args-builder-free-to-args.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-shader-args-builder-free-to-args.returns" role="returns">
<title>Returns</title>
<para>the newly created <link linkend="GBytes"><type>GBytes</type></link>
with all the args added to <parameter>builder</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer full</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-unref" role="function">
<title>gsk_shader_args_builder_unref&#160;()</title>
<indexterm zone="gsk-shader-args-builder-unref"><primary>gsk_shader_args_builder_unref</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_unref (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>);</programlisting>
<para>Decreases the reference count of a <link linkend="GskShaderArgBuilder"><type>GskShaderArgBuilder</type></link> by one.
If the resulting reference count is zero, frees the builder.</para>
<refsect3 id="gsk-shader-args-builder-unref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-ref" role="function">
<title>gsk_shader_args_builder_ref&#160;()</title>
<indexterm zone="gsk-shader-args-builder-ref"><primary>gsk_shader_args_builder_ref</primary></indexterm>
<programlisting language="C"><link linkend="GskShaderArgsBuilder"><returnvalue>GskShaderArgsBuilder</returnvalue></link>&#160;*
gsk_shader_args_builder_ref (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>);</programlisting>
<para>Increases the reference count of a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> by one.</para>
<refsect3 id="gsk-shader-args-builder-ref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gsk-shader-args-builder-ref.returns" role="returns">
<title>Returns</title>
<para> the passed in <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-float" role="function">
<title>gsk_shader_args_builder_set_float&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-float"><primary>gsk_shader_args_builder_set_float</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_float (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                   <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                   <parameter><link linkend="float"><type>float</type></link> value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of float type.</para>
<refsect3 id="gsk-shader-args-builder-set-float.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform to</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-int" role="function">
<title>gsk_shader_args_builder_set_int&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-int"><primary>gsk_shader_args_builder_set_int</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_int (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                 <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                 <parameter><link linkend="gint32"><type>gint32</type></link> value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of int type.</para>
<refsect3 id="gsk-shader-args-builder-set-int.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform to</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-uint" role="function">
<title>gsk_shader_args_builder_set_uint&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-uint"><primary>gsk_shader_args_builder_set_uint</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_uint (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                  <parameter><link linkend="guint32"><type>guint32</type></link> value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of uint type.</para>
<refsect3 id="gsk-shader-args-builder-set-uint.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform to</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-bool" role="function">
<title>gsk_shader_args_builder_set_bool&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-bool"><primary>gsk_shader_args_builder_set_bool</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_bool (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                  <parameter><link linkend="gboolean"><type>gboolean</type></link> value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of bool type.</para>
<refsect3 id="gsk-shader-args-builder-set-bool.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform to</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-vec2" role="function">
<title>gsk_shader_args_builder_set_vec2&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-vec2"><primary>gsk_shader_args_builder_set_vec2</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_vec2 (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                  <parameter>const <link linkend="graphene-vec2-t"><type>graphene_vec2_t</type></link> *value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of vec2 type.</para>
<refsect3 id="gsk-shader-args-builder-set-vec2.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>A <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform too</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-vec3" role="function">
<title>gsk_shader_args_builder_set_vec3&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-vec3"><primary>gsk_shader_args_builder_set_vec3</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_vec3 (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                  <parameter>const <link linkend="graphene-vec3-t"><type>graphene_vec3_t</type></link> *value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of vec3 type.</para>
<refsect3 id="gsk-shader-args-builder-set-vec3.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform too</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gsk-shader-args-builder-set-vec4" role="function">
<title>gsk_shader_args_builder_set_vec4&#160;()</title>
<indexterm zone="gsk-shader-args-builder-set-vec4"><primary>gsk_shader_args_builder_set_vec4</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gsk_shader_args_builder_set_vec4 (<parameter><link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link> *builder</parameter>,
                                  <parameter><link linkend="int"><type>int</type></link> idx</parameter>,
                                  <parameter>const <link linkend="graphene-vec4-t"><type>graphene_vec4_t</type></link> *value</parameter>);</programlisting>
<para>Sets the value of the uniform <parameter>idx</parameter>
.
The uniform must be of vec4 type.</para>
<refsect3 id="gsk-shader-args-builder-set-vec4.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>builder</para></entry>
<entry role="parameter_description"><para>a <link linkend="GskShaderArgsBuilder"><type>GskShaderArgsBuilder</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>idx</para></entry>
<entry role="parameter_description"><para>index of the uniform</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>value</para></entry>
<entry role="parameter_description"><para>value to set the uniform too</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GskGLShader.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GskGLShader-struct" role="struct">
<title>GskGLShader</title>
<indexterm zone="GskGLShader-struct"><primary>GskGLShader</primary></indexterm>
<programlisting language="C">typedef struct _GskGLShader GskGLShader;</programlisting>
<para>An object representing a GL shader program.</para>
</refsect2>
<refsect2 id="GskGLUniformType" role="enum">
<title>enum GskGLUniformType</title>
<indexterm zone="GskGLUniformType"><primary>GskGLUniformType</primary></indexterm>
<para>This defines the types of the uniforms that <link linkend="GskGLShaders"><type>GskGLShaders</type></link>
declare. It defines both what the type is called in the GLSL shader
code, and what the corresponding C type is on the Gtk side.</para>
<refsect3 id="GskGLUniformType.members" role="enum_members">
<title>Members</title>
<informaltable role="enum_members_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="enum_members_name" colwidth="300px"/>
<colspec colname="enum_members_description"/>
<colspec colname="enum_members_annotations" colwidth="200px"/>
<tbody>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-NONE:CAPS">GSK_GL_UNIFORM_TYPE_NONE</para></entry>
<entry role="enum_member_description"><para>No type, used for uninitialized or unspecified values.</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-FLOAT:CAPS">GSK_GL_UNIFORM_TYPE_FLOAT</para></entry>
<entry role="enum_member_description"><para>A float uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-INT:CAPS">GSK_GL_UNIFORM_TYPE_INT</para></entry>
<entry role="enum_member_description"><para>A GLSL int / gint32 uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-UINT:CAPS">GSK_GL_UNIFORM_TYPE_UINT</para></entry>
<entry role="enum_member_description"><para>A GLSL uint / guint32 uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-BOOL:CAPS">GSK_GL_UNIFORM_TYPE_BOOL</para></entry>
<entry role="enum_member_description"><para>A GLSL bool / gboolean uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-VEC2:CAPS">GSK_GL_UNIFORM_TYPE_VEC2</para></entry>
<entry role="enum_member_description"><para>A GLSL vec2 / graphene_vec2_t uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-VEC3:CAPS">GSK_GL_UNIFORM_TYPE_VEC3</para></entry>
<entry role="enum_member_description"><para>A GLSL vec3 / graphene_vec3_t uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
<row role="constant"><entry role="enum_member_name"><para id="GSK-GL-UNIFORM-TYPE-VEC4:CAPS">GSK_GL_UNIFORM_TYPE_VEC4</para></entry>
<entry role="enum_member_description"><para>A GLSL vec4 / graphene_vec4_t uniform</para>
</entry>
<entry role="enum_member_annotations"></entry>
</row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GskShaderArgsBuilder" role="struct">
<title>GskShaderArgsBuilder</title>
<indexterm zone="GskShaderArgsBuilder"><primary>GskShaderArgsBuilder</primary></indexterm>
<programlisting language="C">typedef struct _GskShaderArgsBuilder GskShaderArgsBuilder;</programlisting>
<para>An object to build the uniforms data for a <link linkend="GskGLShader"><type>GskGLShader</type></link>.</para>
</refsect2>

</refsect1>
<refsect1 id="GskGLShader.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GskGLShader--resource" role="property"><title>The <literal>“resource”</literal> property</title>
<indexterm zone="GskGLShader--resource"><primary>GskGLShader:resource</primary></indexterm>
<programlisting>  “resource”                 <link linkend="char"><type>char</type></link>&#160;*</programlisting>
<para>Resource containing the source code for the shader.</para>
<para>If the shader source is not coming from a resource, this
will be <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<para>Owner: GskGLShader</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
<para>Default value: NULL</para>
</refsect2>
<refsect2 id="GskGLShader--source" role="property"><title>The <literal>“source”</literal> property</title>
<indexterm zone="GskGLShader--source"><primary>GskGLShader:source</primary></indexterm>
<programlisting>  “source”                   <link linkend="GBytes"><type>GBytes</type></link>&#160;*</programlisting>
<para>The sourcecode for the shader.</para><para>Owner: GskGLShader</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
</refsect2>

</refsect1>

</refentry>
