[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49784] branches/soc-2012-swiss_cheese/ source: Renaming gpu functions from gpu* to gpu_gl* because they aren' t abstractions

Alexander Kuznetsov kuzsasha at gmail.com
Fri Aug 10 23:42:02 CEST 2012


Revision: 49784
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49784
Author:   alexk
Date:     2012-08-10 21:42:02 +0000 (Fri, 10 Aug 2012)
Log Message:
-----------
Renaming gpu functions from gpu* to gpu_gl* because they aren't abstractions

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/editors/transform/transform_manipulator.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_functions.c
    branches/soc-2012-swiss_cheese/source/gameengine/Ketsji/BL_Shader.cpp
    branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp
    branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVBO.cpp

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/transform/transform_manipulator.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/transform/transform_manipulator.c	2012-08-10 21:17:20 UTC (rev 49783)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/transform/transform_manipulator.c	2012-08-10 21:42:02 UTC (rev 49784)
@@ -1192,28 +1192,28 @@
 	gpuPushMatrix();
 	gpuScale(size, size, size);
 
-	gpuBegin(GL_QUADS);
+	gpuBegin(GL_TRIANGLE_FAN);
 	n[0] = -1.0;
 	gpuNormal3fv(n);
 	gpuVertex3fv(cube[0]); gpuVertex3fv(cube[1]); gpuVertex3fv(cube[2]); gpuVertex3fv(cube[3]);
 	n[0] = 0;
 	gpuEnd();
 
-	gpuBegin(GL_QUADS);
+	gpuBegin(GL_TRIANGLE_FAN);
 	n[1] = -1.0;
 	gpuNormal3fv(n);
 	gpuVertex3fv(cube[0]); gpuVertex3fv(cube[4]); gpuVertex3fv(cube[5]); gpuVertex3fv(cube[1]);
 	n[1] = 0;
 	gpuEnd();
 
-	gpuBegin(GL_QUADS);
+	gpuBegin(GL_TRIANGLE_FAN);
 	n[0] = 1.0;
 	gpuNormal3fv(n);
 	gpuVertex3fv(cube[4]); gpuVertex3fv(cube[7]); gpuVertex3fv(cube[6]); gpuVertex3fv(cube[5]);
 	n[0] = 0;
 	gpuEnd();
 
-	gpuBegin(GL_QUADS);
+	gpuBegin(GL_TRIANGLE_FAN);
 	n[1] = 1.0;
 	gpuNormal3fv(n);
 	gpuVertex3fv(cube[7]); gpuVertex3fv(cube[3]); gpuVertex3fv(cube[2]); gpuVertex3fv(cube[6]);

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h	2012-08-10 21:17:20 UTC (rev 49783)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_functions.h	2012-08-10 21:42:02 UTC (rev 49784)
@@ -194,61 +194,61 @@
 extern "C" {
 #endif
 
-GPUFUNC GLuint (GLAPIENTRY* gpuCreateShader)(GLuint shaderType);
-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 (GLAPIENTRY* gpuGetShaderiv)(GLuint shader, GLuint pname, GLint *params);
-GPUFUNC void (GLAPIENTRY* gpuGetShaderInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
+GPUFUNC GLuint (GLAPIENTRY* gpu_glCreateShader)(GLuint shaderType);
+GPUFUNC void (GLAPIENTRY* gpu_glAttachShader)(GLuint program, GLuint shader);
+GPUFUNC void (GLAPIENTRY* gpu_glShaderSource)(GLuint shader, GLint count, const GLchar ** string, const GLint * length);
+GPUFUNC void (GLAPIENTRY* gpu_glCompileShader)(GLuint shader);
+GPUFUNC void (GLAPIENTRY* gpu_glGetShaderiv)(GLuint shader, GLuint pname, GLint *params);
+GPUFUNC void (GLAPIENTRY* gpu_glGetShaderInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
 
-GPUFUNC GLuint (GLAPIENTRY* gpuCreateProgram)(void);
-GPUFUNC void (GLAPIENTRY* gpuLinkProgram)(GLuint program);
-GPUFUNC void (GLAPIENTRY* gpuGetProgramiv)(GLuint shader, GLuint pname, GLint *params);
-GPUFUNC void (GLAPIENTRY* gpuGetProgramInfoLog)(GLuint shader, GLint maxLength, GLint *length, GLchar *infoLog);
+GPUFUNC GLuint (GLAPIENTRY* gpu_glCreateProgram)(void);
+GPUFUNC void (GLAPIENTRY* gpu_glLinkProgram)(GLuint program);
+GPUFUNC void (GLAPIENTRY* gpu_glGetProgramiv)(GLuint shader, GLuint pname, GLint *params);
+GPUFUNC void (GLAPIENTRY* gpu_glGetProgramInfoLog)(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* gpu_glUniform1i)(GLint location, GLint v0);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform1f)(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* gpu_glUniform1iv)(GLint location, GLint count, const GLint * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform2iv)(GLint location, GLint count, const GLint * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform3iv)(GLint location, GLint count, const GLint * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform4iv)(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);
-GPUFUNC void (GLAPIENTRY* gpuUniform4fv)(GLint location, GLint count, const GLfloat * value);
-GPUFUNC void (GLAPIENTRY* gpuUniformMatrix3fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
-GPUFUNC void (GLAPIENTRY* gpuUniformMatrix4fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform1fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform2fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform3fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniform4fv)(GLint location, GLint count, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniformMatrix3fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
+GPUFUNC void (GLAPIENTRY* gpu_glUniformMatrix4fv)(GLint location, GLint count, GLboolean transpose, const GLfloat * value);
 
-GPUFUNC GLint (GLAPIENTRY* gpuGetAttribLocation)(GLuint program, const GLchar *name);
-GPUFUNC void (GLAPIENTRY* gpuBindAttribLocation)(GLuint program, GLuint index, const GLchar * name);
-GPUFUNC GLint (GLAPIENTRY* gpuGetUniformLocation)(GLuint program, const GLchar * name);
+GPUFUNC GLint (GLAPIENTRY* gpu_glGetAttribLocation)(GLuint program, const GLchar *name);
+GPUFUNC void (GLAPIENTRY* gpu_glBindAttribLocation)(GLuint program, GLuint index, const GLchar * name);
+GPUFUNC GLint (GLAPIENTRY* gpu_glGetUniformLocation)(GLuint program, const GLchar * name);
 
-GPUFUNC void (GLAPIENTRY* gpuVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *  pointer);
+GPUFUNC void (GLAPIENTRY* gpu_glVertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *  pointer);
 
-GPUFUNC void (GLAPIENTRY* gpuEnableVertexAttribArray)(GLuint index);
-GPUFUNC void (GLAPIENTRY* gpuDisableVertexAttribArray)(GLuint index);
+GPUFUNC void (GLAPIENTRY* gpu_glEnableVertexAttribArray)(GLuint index);
+GPUFUNC void (GLAPIENTRY* gpu_glDisableVertexAttribArray)(GLuint index);
 
-GPUFUNC void (GLAPIENTRY* gpuUseProgram)(GLuint program);
-GPUFUNC void (GLAPIENTRY* gpuDeleteShader)(GLuint shader);
-GPUFUNC void (GLAPIENTRY* gpuDeleteProgram)(GLuint program);
+GPUFUNC void (GLAPIENTRY* gpu_glUseProgram)(GLuint program);
+GPUFUNC void (GLAPIENTRY* gpu_glDeleteShader)(GLuint shader);
+GPUFUNC void (GLAPIENTRY* gpu_glDeleteProgram)(GLuint program);
 
 
 
-GPUFUNC void (GLAPIENTRY* gpuGenFramebuffers)(GLint m, GLuint * ids);
-GPUFUNC void (GLAPIENTRY* gpuBindFramebuffer)(GLuint target, GLuint framebuffer);
-GPUFUNC void (GLAPIENTRY* gpuDeleteFramebuffers)(GLint n, const GLuint * framebuffers);
+GPUFUNC void (GLAPIENTRY* gpu_glGenFramebuffers)(GLint m, GLuint * ids);
+GPUFUNC void (GLAPIENTRY* gpu_glBindFramebuffer)(GLuint target, GLuint framebuffer);
+GPUFUNC void (GLAPIENTRY* gpu_glDeleteFramebuffers)(GLint n, const GLuint * framebuffers);
 
-GPUFUNC void (GLAPIENTRY* gpuGenBuffers)(GLsizei  n, GLuint *buffers);
-GPUFUNC void (GLAPIENTRY* gpuBindBuffer)(GLenum target, GLuint buffer);
-GPUFUNC void (GLAPIENTRY* gpuBufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
-GPUFUNC void (GLAPIENTRY* gpuDeleteBuffers)(GLsizei  n, const GLuint * buffers);
+GPUFUNC void (GLAPIENTRY* gpu_glGenBuffers)(GLsizei  n, GLuint *buffers);
+GPUFUNC void (GLAPIENTRY* gpu_glBindBuffer)(GLenum target, GLuint buffer);
+GPUFUNC void (GLAPIENTRY* gpu_glBufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
+GPUFUNC void (GLAPIENTRY* gpu_glDeleteBuffers)(GLsizei  n, const GLuint * buffers);
 
-GPUFUNC void * (GLAPIENTRY* gpuMapBuffer)(GLenum target, GLenum access);
-GPUFUNC GLboolean (GLAPIENTRY* gpuUnmapBuffer)(GLenum  target);
+GPUFUNC void * (GLAPIENTRY* gpu_glMapBuffer)(GLenum target, GLenum access);
+GPUFUNC GLboolean (GLAPIENTRY* gpu_glUnmapBuffer)(GLenum  target);
 
 GPUFUNC const void * (GLAPIENTRY* gpuBufferStartUpdate)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
 GPUFUNC void (GLAPIENTRY* gpuBufferFinishUpdate)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-08-10 21:17:20 UTC (rev 49783)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-08-10 21:42:02 UTC (rev 49784)
@@ -158,7 +158,6 @@
 
 	vendor = (const char*)glGetString(GL_VENDOR);
 	renderer = (const char*)glGetString(GL_RENDERER);
-#include FAKE_GL_MODE
 
 	if (strstr(vendor, "ATI")) {
 		GG.device = GPU_DEVICE_ATI;
@@ -258,7 +257,6 @@
 int GPU_print_error(const char *str)
 {
 	GLenum errCode;
-#include REAL_GL_MODE
 	if (G.debug & G_DEBUG) {
 		if ((errCode = glGetError()) != GL_NO_ERROR) {
 			fprintf(stderr, "%s opengl error: %s\n", str, gpuErrorString(errCode));
@@ -757,7 +755,7 @@
 		return NULL;
 	
 	fb= MEM_callocN(sizeof(GPUFrameBuffer), "GPUFrameBuffer");
-	gpuGenFramebuffers(1, &fb->object);
+	gpu_glGenFramebuffers(1, &fb->object);
 
 	if (!fb->object) {
 		fprintf(stderr, "GPUFFrameBuffer: framebuffer gen failed. %s\n",
@@ -883,10 +881,10 @@
 		GPU_framebuffer_texture_detach(fb, fb->colortex);
 
 	if (fb->object) {
-		gpuDeleteFramebuffers(1, &fb->object);
+		gpu_glDeleteFramebuffers(1, &fb->object);
 
 		if (GG.currentfb == fb->object) {
-			gpuBindFramebuffer(GL_FRAMEBUFFER, 0);
+			gpu_glBindFramebuffer(GL_FRAMEBUFFER, 0);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list