<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src/pvr2</tt></b></td></tr>
<tr><td><tt><a href="#file1">gl_sl.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+42</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">a486ac64f34b -> a9b41bcb8410</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file2">glutil.h</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+2</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">a486ac64f34b -> a9b41bcb8410</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+44</td><td></td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >2 modified files</small><br />
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Add support for matrix uniforms + vertex attribs
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>gl_sl.c</b></big> <small id="info" style="color: #888888;" >a486ac64f34b -> a9b41bcb8410</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/gl_sl.c
+++ lxdream/src/pvr2/gl_sl.c
@@ -156,11 +156,21 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     return glGetUniformLocationARB(program, name);
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static inline GLint glsl_get_attrib_location_prim(gl_program_t program, const char *name)
+{
+    return glGetAttribLocationARB(program, name);
+}
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static inline void glsl_set_uniform_int_prim(GLint location, GLint value)
 {
     glUniform1iARB(location,value);
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static inline void glsl_set_uniform_mat4_prim(GLint location, GLfloat *value)
+{
+    glUniformMatrix4fvARB(location, 1, GL_FALSE, value);
+}
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #elif HAVE_OPENGL_SHADER
 
 gboolean glsl_is_supported()
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -278,6 +288,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glUniform1i(location, value);
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static inline void glsl_set_uniform_mat4_prim(GLint location, GLfloat *value)
+{
+    glUniformMatrix4fv(location, 1, GL_TRUE, value);
+}
+
+static inline GLint glsl_get_attrib_location_prim(gl_program_t program, const char *name)
+{
+    return glGetAttribLocation(program, name);
+}
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #else
 gboolean glsl_is_supported()
 {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -324,6 +343,15 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static inline void glsl_set_uniform_int_prim(GLint location, GLint value)
 {
 }
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+
+static inline void glsl_set_uniform_mat4_prim(GLint location, GLfloat *value)
+{
+}
+
+static inline GLint glsl_get_attrib_location_prim(gl_program_t program, const char *name)
+{
+    return 0;
+}
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #endif
 
 /****************************************************************************/
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -435,6 +463,13 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     return glsl_get_uniform_location_prim(program_array[program], name);
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+GLint glsl_get_attrib_location( unsigned program, const char *name )
+{
+    assert( program >= 0 && program <= GLSL_LAST_PROGRAM );
+
+    return glsl_get_attrib_location_prim(program_array[program], name);
+}
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > void glsl_set_uniform_int( unsigned program, const char *name, GLint value )
 {
     assert( program >= 0 && program <= GLSL_LAST_PROGRAM );
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -442,6 +477,13 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     glsl_set_uniform_int_prim(location, value);
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void glsl_set_uniform_mat4( unsigned program, const char *name, GLfloat *value )
+{
+    assert( program >= 0 && program <= GLSL_LAST_PROGRAM );
+    GLint location = glsl_get_uniform_location_prim(program_array[program], name);
+    glsl_set_uniform_mat4_prim(location, value);
+}
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > void glsl_clear_shader()
 {
     glsl_use_program(0);
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>glutil.h</b></big> <small id="info" style="color: #888888;" >a486ac64f34b -> a9b41bcb8410</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glutil.h
+++ lxdream/src/pvr2/glutil.h
@@ -65,6 +65,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > void glsl_clear_shader();
 GLint glsl_get_uniform_location( unsigned program, const char *name );
 void glsl_set_uniform_int( unsigned program, const char *name, GLint value );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void glsl_set_uniform_mat4( unsigned program, const char *name, GLfloat *value );
+GLint glsl_get_attrib_location(unsigned program, const char *name);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 /* Convenience formatting function for driver use */
 void fprint_extensions( FILE *out, const char *extensions );
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>