[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48688] branches/soc-2012-swiss_cheese/ source/blender/gpu: Extends GPU functions to almost all uniforms
Alexander Kuznetsov
kuzsasha at gmail.com
Fri Jul 6 19:51:27 CEST 2012
Revision: 48688
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48688
Author: alexk
Date: 2012-07-06 17:51:27 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
Extends GPU functions to almost all uniforms
Modified Paths:
--------------
branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c
Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h 2012-07-06 16:55:35 UTC (rev 48687)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h 2012-07-06 17:51:27 UTC (rev 48688)
@@ -173,6 +173,11 @@
# endif
#endif
+#ifdef WITH_ANDROID
+#undef GLEWAPI
+# define GLEWAPI extern __attribute__ ((visibility("default")))
+#endif
+
/* <glu.h> */
#ifndef GLAPI
#define GLAPI extern
@@ -193,17 +198,24 @@
GPUFUNC void (GLAPIENTRY* gpuAttachShader)(GLuint program, GLuint shader);
GPUFUNC void (GLAPIENTRY* gpuShaderSource)(GLuint shader, GLint count, const GLchar ** string, const GLint * length);
GPUFUNC void (GLAPIENTRY* gpuCompileShader)(GLuint shader);
-GPUFUNC void (* gpuGetShaderiv)(GLuint shader, GLuint pname, GLint *params);
+GPUFUNC void (GLAPIENTRY* gpuGetShaderiv)(GLuint shader, GLuint pname, GLint *params);
GPUFUNC void (GLAPIENTRY* gpuGetShaderInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
GPUFUNC GLuint (GLAPIENTRY* gpuCreateProgram)(void);
GPUFUNC void (GLAPIENTRY* gpuLinkProgram)(GLuint program);
-GPUFUNC void (* gpuGetProgramiv)(GLuint shader, GLuint pname, GLint *params);
+GPUFUNC void (GLAPIENTRY* gpuGetProgramiv)(GLuint shader, GLuint pname, GLint *params);
GPUFUNC void (GLAPIENTRY* gpuGetProgramInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
GPUFUNC void (GLAPIENTRY* gpuUniform1i)(GLint location, GLint v0);
+GPUFUNC void (GLAPIENTRY* gpuUniform1f)(GLint location, GLfloat v0);
+GPUFUNC void (GLAPIENTRY* gpuUniform1iv)(GLint location, GLint count, const GLint * value);
+GPUFUNC void (GLAPIENTRY* gpuUniform2iv)(GLint location, GLint count, const GLint * value);
+GPUFUNC void (GLAPIENTRY* gpuUniform3iv)(GLint location, GLint count, const GLint * value);
+GPUFUNC void (GLAPIENTRY* gpuUniform4iv)(GLint location, GLint count, const GLint * value);
+
+
GPUFUNC void (GLAPIENTRY* gpuUniform1fv)(GLint location, GLint count, const GLfloat * value);
GPUFUNC void (GLAPIENTRY* gpuUniform2fv)(GLint location, GLint count, const GLfloat * value);
GPUFUNC void (GLAPIENTRY* gpuUniform3fv)(GLint location, GLint count, const GLfloat * value);
@@ -212,6 +224,7 @@
GPUFUNC void (GLAPIENTRY* gpuUniformMatrix4fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
GPUFUNC GLint (GLAPIENTRY* gpuGetAttribLocation)(GLuint program, const GLchar *name);
+GPUFUNC GLint (GLAPIENTRY* gpuBindAttribLocation)(GLuint program, GLuint index, const GLchar * name);
GPUFUNC GLint (GLAPIENTRY* gpuGetUniformLocation)(GLuint program, const GLchar * name);
Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c 2012-07-06 16:55:35 UTC (rev 48687)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c 2012-07-06 17:51:27 UTC (rev 48688)
@@ -26,6 +26,9 @@
* \ingroup gpu
*/
+#include <stdlib.h>
+#include <stdio.h>
+
#ifdef GLES
#include <GLES2/gl2.h>
#endif
@@ -81,6 +84,12 @@
gpuGetProgramInfoLog = glGetInfoLogARB;
gpuUniform1i = glUniform1iARB;
+ gpuUniform1f = glUniform1fARB;
+
+ gpuUniform1iv = glUniform1ivARB;
+ gpuUniform2iv = glUniform2ivARB;
+ gpuUniform3iv = glUniform3ivARB;
+ gpuUniform4iv = glUniform4ivARB;
gpuUniform1fv = glUniform1fvARB;
gpuUniform2fv = glUniform2fvARB;
@@ -91,6 +100,7 @@
gpuUniformMatrix4fv = glUniformMatrix4fvARB;
gpuGetAttribLocation = glGetAttribLocationARB;
+ gpuBindAttribLocation = glBindAttribLocationARB;
gpuGetUniformLocation = glGetUniformLocationARB;
gpuUseProgram = glUseProgramObjectARB;
@@ -121,16 +131,22 @@
gpuAttachShader = glAttachShader;
gpuShaderSource = glShaderSource;
gpuCompileShader = glCompileShader;
- gpuGetShaderiv = check_glGetShaderiv;
+ gpuGetShaderiv = glGetShaderiv;
gpuGetShaderInfoLog = glGetShaderInfoLog;
gpuCreateProgram = glCreateProgram;
gpuLinkProgram = glLinkProgram;
- gpuGetProgramiv = check_glGetProgramiv;
+ gpuGetProgramiv = glGetProgramiv;
gpuGetProgramInfoLog = glGetProgramInfoLog;
gpuUniform1i = glUniform1i;
+ gpuUniform1f = glUniform1f;
+ gpuUniform1iv = glUniform1iv;
+ gpuUniform2iv = glUniform2iv;
+ gpuUniform3iv = glUniform3iv;
+ gpuUniform4iv = glUniform4iv;
+
gpuUniform1fv = glUniform1fv;
gpuUniform2fv = glUniform2fv;
gpuUniform3fv = glUniform3fv;
@@ -140,6 +156,7 @@
gpuUniformMatrix4fv = glUniformMatrix4fv;
gpuGetAttribLocation = glGetAttribLocation;
+ gpuBindAttribLocation = glBindAttribLocation;
gpuGetUniformLocation = glGetUniformLocation;
gpuUseProgram = glUseProgram;
@@ -172,8 +189,13 @@
void GPU_func_comp_init(void)
{
#ifdef GLES
+//exit(0);
init_glsl_standard();
init_framebuffers_standard();
+
+
+ printf("gpuUniform3iv: %p\n", gpuUniform3iv);
+ //exit(0);
#else
/* Here we rely on GLEW
We expect all symbols be present, even if they are only 0,
More information about the Bf-blender-cvs
mailing list