Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-03-22 12:30:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-03-22 12:30:00 +0300
commit1e9bf0cfdb6c925b28af6f0330467e7d9d798c05 (patch)
treec8356d8bc812dc6e3f23b9c381e94ec4c9d4c879 /source/blender/gpu
parent9b2dd9aac65aa49c05176bb8b7aabde9fe1aeeac (diff)
spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text)
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_extensions.h12
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c4
-rw-r--r--source/blender/gpu/intern/gpu_codegen.h2
-rw-r--r--source/blender/gpu/intern/gpu_draw.c4
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c28
-rw-r--r--source/blender/gpu/intern/gpu_material.c62
6 files changed, 56 insertions, 56 deletions
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 90b0ac2aee9..686e89b8310 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -91,14 +91,14 @@ int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
/* GPU Texture
- always returns unsigned char RGBA textures
- if texture with non square dimensions is created, depending on the
- graphics card capabilities the texture may actually be stored in a
+ graphics card capabilities the texture may actually be stored in a
larger texture with power of two dimensions. the actual dimensions
may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
calls glTexCoord2f with the coordinates adjusted for this.
- can use reference counting:
- - reference counter after GPU_texture_create is 1
- - GPU_texture_ref increases by one
- - GPU_texture_free decreases by one, and frees if 0
+ - reference counter after GPU_texture_create is 1
+ - GPU_texture_ref increases by one
+ - GPU_texture_free decreases by one, and frees if 0
- if created with from_blender, will not free the texture
*/
@@ -123,10 +123,10 @@ int GPU_texture_opengl_height(GPUTexture *tex);
/* GPU Framebuffer
- this is a wrapper for an OpenGL framebuffer object (FBO). in practice
- multiple FBO's may be created, to get around limitations on the number
+ multiple FBO's may be created, to get around limitations on the number
of attached textures and the dimension requirements.
- after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
- be called before rendering to the window framebuffer again */
+ be called before rendering to the window framebuffer again */
GPUFrameBuffer *GPU_framebuffer_create();
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex);
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index efaae5c2720..a3196f5125b 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -492,7 +492,7 @@ static void codegen_set_unique_ids(ListBase *nodes)
/* set texid used for settings texture slot with multitexture */
if (codegen_input_has_texture(input) &&
- ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) {
+ ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL))) {
if (input->link) {
/* input is texture from buffer, assign only one texid per
buffer to avoid sampling the same texture twice */
@@ -1033,7 +1033,7 @@ static void gpu_node_input_socket(GPUNode *node, GPUNodeStack *sock)
gpu_node_input_link(node, sock->link, sock->type);
}
else {
- link = GPU_node_link_create(0);
+ link = GPU_node_link_create(0);
link->ptr1 = sock->vec;
gpu_node_input_link(node, link, sock->type);
}
diff --git a/source/blender/gpu/intern/gpu_codegen.h b/source/blender/gpu/intern/gpu_codegen.h
index 883c1abe034..3272f0fa1a9 100644
--- a/source/blender/gpu/intern/gpu_codegen.h
+++ b/source/blender/gpu/intern/gpu_codegen.h
@@ -59,7 +59,7 @@ GPUFunction *GPU_lookup_function(char *name);
/* Pass Generation
- Takes a list of nodes and a desired output, and makes a pass. This
- will take ownership of the nodes and free them early if unused or
+ will take ownership of the nodes and free them early if unused or
at the end if used.
*/
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 10638ca552a..f00126a7fab 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -762,11 +762,11 @@ void GPU_free_smoke(SmokeModifierData *smd)
if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain)
{
if(smd->domain->tex)
- GPU_texture_free(smd->domain->tex);
+ GPU_texture_free(smd->domain->tex);
smd->domain->tex = NULL;
if(smd->domain->tex_shadow)
- GPU_texture_free(smd->domain->tex_shadow);
+ GPU_texture_free(smd->domain->tex_shadow);
smd->domain->tex_shadow = NULL;
}
}
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index 3ca55c12ce2..4b735a8bd84 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -176,7 +176,7 @@ int GPU_print_error(char *str)
if (G.f & G_DEBUG) {
if ((errCode = glGetError()) != GL_NO_ERROR) {
- fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
+ fprintf(stderr, "%s opengl error: %s\n", str, gluErrorString(errCode));
return 1;
}
}
@@ -1138,7 +1138,7 @@ GPUPixelBuffer *gpu_pixelbuffer_create(int x, int y, int halffloat, int numbuffe
pb->numbuffers = numbuffers;
pb->halffloat = halffloat;
- glGenBuffersARB(pb->numbuffers, pb->bindcode);
+ glGenBuffersARB(pb->numbuffers, pb->bindcode);
if (!pb->bindcode[0]) {
fprintf(stderr, "GPUPixelBuffer allocation failed\n");
@@ -1154,9 +1154,9 @@ void GPU_pixelbuffer_texture(GPUTexture *tex, GPUPixelBuffer *pb)
void *pixels;
int i;
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
- for (i = 0; i < pb->numbuffers; i++) {
+ for (i = 0; i < pb->numbuffers; i++) {
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->bindcode[pb->current]);
glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_EXT, pb->datasize, NULL,
GL_STREAM_DRAW_ARB);
@@ -1170,22 +1170,22 @@ void GPU_pixelbuffer_texture(GPUTexture *tex, GPUPixelBuffer *pb)
}
}
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
}
static int pixelbuffer_map_into_gpu(GLuint bindcode)
{
void *pixels;
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
pixels = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, GL_WRITE_ONLY);
/* do stuff in pixels */
- if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT)) {
+ if (!glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT)) {
fprintf(stderr, "Could not unmap opengl PBO\n");
return 0;
- }
+ }
return 1;
}
@@ -1193,14 +1193,14 @@ static int pixelbuffer_map_into_gpu(GLuint bindcode)
static void pixelbuffer_copy_to_texture(GPUTexture *tex, GPUPixelBuffer *pb, GLuint bindcode)
{
GLenum type = (pb->halffloat)? GL_HALF_FLOAT_NV: GL_UNSIGNED_BYTE;
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
- glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, tex->bindcode);
+ glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, bindcode);
- glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, tex->w, tex->h,
- GL_RGBA, type, NULL);
+ glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, tex->w, tex->h,
+ GL_RGBA, type, NULL);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
+ glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
}
void GPU_pixelbuffer_async_to_gpu(GPUTexture *tex, GPUPixelBuffer *pb)
@@ -1217,7 +1217,7 @@ void GPU_pixelbuffer_async_to_gpu(GPUTexture *tex, GPUPixelBuffer *pb)
pixelbuffer_map_into_gpu(pb->bindcode[newbuffer]);
pixelbuffer_copy_to_texture(tex, pb, pb->bindcode[pb->current]);
- }
+ }
}
#endif
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 03afa0b1b5a..c81ddd6a770 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -435,34 +435,34 @@ static GPUNodeLink *lamp_get_visibility(GPUMaterial *mat, GPULamp *lamp, GPUNode
#if 0
static void area_lamp_vectors(LampRen *lar)
{
- float xsize= 0.5*lar->area_size, ysize= 0.5*lar->area_sizey, multifac;
-
- /* make it smaller, so area light can be multisampled */
- multifac= 1.0f/sqrt((float)lar->ray_totsamp);
- xsize *= multifac;
- ysize *= multifac;
-
- /* corner vectors */
- lar->area[0][0]= lar->co[0] - xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
- lar->area[0][1]= lar->co[1] - xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
- lar->area[0][2]= lar->co[2] - xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
-
- /* corner vectors */
- lar->area[1][0]= lar->co[0] - xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
- lar->area[1][1]= lar->co[1] - xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
- lar->area[1][2]= lar->co[2] - xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
-
- /* corner vectors */
- lar->area[2][0]= lar->co[0] + xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
- lar->area[2][1]= lar->co[1] + xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
- lar->area[2][2]= lar->co[2] + xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
-
- /* corner vectors */
- lar->area[3][0]= lar->co[0] + xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
- lar->area[3][1]= lar->co[1] + xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
- lar->area[3][2]= lar->co[2] + xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
- /* only for correction button size, matrix size works on energy */
- lar->areasize= lar->dist*lar->dist/(4.0*xsize*ysize);
+ float xsize= 0.5*lar->area_size, ysize= 0.5*lar->area_sizey, multifac;
+
+ /* make it smaller, so area light can be multisampled */
+ multifac= 1.0f/sqrt((float)lar->ray_totsamp);
+ xsize *= multifac;
+ ysize *= multifac;
+
+ /* corner vectors */
+ lar->area[0][0]= lar->co[0] - xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
+ lar->area[0][1]= lar->co[1] - xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
+ lar->area[0][2]= lar->co[2] - xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[1][0]= lar->co[0] - xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
+ lar->area[1][1]= lar->co[1] - xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
+ lar->area[1][2]= lar->co[2] - xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[2][0]= lar->co[0] + xsize*lar->mat[0][0] + ysize*lar->mat[1][0];
+ lar->area[2][1]= lar->co[1] + xsize*lar->mat[0][1] + ysize*lar->mat[1][1];
+ lar->area[2][2]= lar->co[2] + xsize*lar->mat[0][2] + ysize*lar->mat[1][2];
+
+ /* corner vectors */
+ lar->area[3][0]= lar->co[0] + xsize*lar->mat[0][0] - ysize*lar->mat[1][0];
+ lar->area[3][1]= lar->co[1] + xsize*lar->mat[0][1] - ysize*lar->mat[1][1];
+ lar->area[3][2]= lar->co[2] + xsize*lar->mat[0][2] - ysize*lar->mat[1][2];
+ /* only for correction button size, matrix size works on energy */
+ lar->areasize= lar->dist*lar->dist/(4.0*xsize*ysize);
}
#endif
@@ -965,7 +965,7 @@ static void do_material_tex(GPUShadeInput *shi)
if(tex->imaflag & TEX_USEALPHA)
talpha= 1;
- }
+ }
else continue;
/* texture output */
@@ -1187,7 +1187,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
shr->alpha = shi->alpha;
if(world) {
- /* exposure correction */
+ /* exposure correction */
if(world->exp!=0.0f || world->range!=1.0f) {
linfac= 1.0 + pow((2.0*world->exp + 0.5), -10);
logfac= log((linfac-1.0)/linfac)/world->range;
@@ -1478,7 +1478,7 @@ void GPU_lamp_free(Object *ob)
int GPU_lamp_has_shadow_buffer(GPULamp *lamp)
{
return (!(lamp->scene->gm.flag & GAME_GLSL_NO_SHADOWS) &&
- !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) &&
+ !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) &&
lamp->tex && lamp->fb);
}