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:
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_batch.h2
-rw-r--r--source/blender/gpu/intern/gpu_compositing.c2
-rw-r--r--source/blender/gpu/intern/gpu_draw.c5
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.c8
-rw-r--r--source/blender/gpu/intern/gpu_lamp.c2
-rw-r--r--source/blender/gpu/intern/gpu_matrix.c20
-rw-r--r--source/blender/gpu/intern/gpu_shader.c2
-rw-r--r--source/blender/gpu/intern/gpu_uniformbuffer.c7
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c4
9 files changed, 27 insertions, 25 deletions
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h
index 27d1d1f902e..6d16092996e 100644
--- a/source/blender/gpu/GPU_batch.h
+++ b/source/blender/gpu/GPU_batch.h
@@ -39,7 +39,7 @@
#include "GPU_shader.h"
/* Extend GWN_batch_program_set to use Blender’s library of built-in shader programs. */
-void GWN_batch_program_set_builtin(Gwn_Batch*, GPUBuiltinShader);
+void GWN_batch_program_set_builtin(Gwn_Batch *, GPUBuiltinShader);
/* Replacement for gluSphere */
Gwn_Batch *GPU_batch_preset_sphere(int lod);
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 5bb9fe95099..12ed67cdf4e 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -281,7 +281,7 @@ GPUFX *GPU_fx_compositor_create(void)
}
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
GWN_vertbuf_data_alloc(vbo, 4);
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i) {
GWN_vertbuf_attr_set(vbo, pos, i, fullscreencos[i]);
GWN_vertbuf_attr_set(vbo, uvs, i, fullscreenuvs[i]);
}
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 1ab1cba2504..cc6afe983ca 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1280,7 +1280,7 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres)
}
sds->tex_flame = (smoke_turbulence_has_fuel(sds->wt)) ?
GPU_texture_create_3D_custom(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], 1,
- GPU_R8, smoke_turbulence_get_flame(sds->wt), NULL):
+ GPU_R8, smoke_turbulence_get_flame(sds->wt), NULL) :
NULL;
}
@@ -2425,7 +2425,8 @@ void gpuPushAttrib(eGPUAttribMask mask)
AttribStack.top++;
}
-static void restore_mask(GLenum cap, const bool value) {
+static void restore_mask(GLenum cap, const bool value)
+{
if (value) {
glEnable(cap);
}
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index e7b70b70d80..6b19cea464b 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -573,7 +573,7 @@ void GPU_framebuffer_recursive_downsample(
glReadBuffer(GL_COLOR_ATTACHMENT0);
}
- for (i=1; i < num_iter+1 && (current_dim[0] > 4 && current_dim[1] > 4); i++) {
+ for (i = 1; i < num_iter + 1 && (current_dim[0] > 4 && current_dim[1] > 4); i++) {
/* calculate next viewport size */
current_dim[0] /= 2;
@@ -587,8 +587,8 @@ void GPU_framebuffer_recursive_downsample(
/* bind next level for rendering but first restrict fetches only to previous level */
GPU_texture_bind(tex, 0);
- glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, i-1);
- glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i-1);
+ glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, i - 1);
+ glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i - 1);
GPU_texture_unbind(tex);
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), i);
@@ -601,7 +601,7 @@ void GPU_framebuffer_recursive_downsample(
/* reset mipmap level range for the depth image */
GPU_texture_bind(tex, 0);
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, 0);
- glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i-1);
+ glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i - 1);
GPU_texture_unbind(tex);
}
diff --git a/source/blender/gpu/intern/gpu_lamp.c b/source/blender/gpu/intern/gpu_lamp.c
index 23bfb1dfb6b..fbc1ace1292 100644
--- a/source/blender/gpu/intern/gpu_lamp.c
+++ b/source/blender/gpu/intern/gpu_lamp.c
@@ -376,7 +376,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
void GPU_lamp_engine_data_free(LampEngineData *led)
{
- for (int i = 0; i < MAX_LAMP_DATA; ++i) {
+ for (int i = 0; i < MAX_LAMP_DATA; ++i) {
if (led->storage[i]) {
MEM_freeN(led->storage[i]);
led->storage[i] = NULL;
diff --git a/source/blender/gpu/intern/gpu_matrix.c b/source/blender/gpu/intern/gpu_matrix.c
index 11575d8062c..b6214f2778b 100644
--- a/source/blender/gpu/intern/gpu_matrix.c
+++ b/source/blender/gpu/intern/gpu_matrix.c
@@ -574,33 +574,33 @@ void gpuBindMatrices(const Gwn_ShaderInterface *shaderface)
const Gwn_ShaderInput *P_inv = GWN_shaderinterface_uniform_builtin(shaderface, GWN_UNIFORM_PROJECTION_INV);
if (MV) {
- #if DEBUG_MATRIX_BIND
+#if DEBUG_MATRIX_BIND
puts("setting MV matrix");
- #endif
+#endif
glUniformMatrix4fv(MV->location, 1, GL_FALSE, (const float *)gpuGetModelViewMatrix(NULL));
}
if (P) {
- #if DEBUG_MATRIX_BIND
+#if DEBUG_MATRIX_BIND
puts("setting P matrix");
- #endif
+#endif
glUniformMatrix4fv(P->location, 1, GL_FALSE, (const float *)gpuGetProjectionMatrix(NULL));
}
if (MVP) {
- #if DEBUG_MATRIX_BIND
+#if DEBUG_MATRIX_BIND
puts("setting MVP matrix");
- #endif
+#endif
glUniformMatrix4fv(MVP->location, 1, GL_FALSE, (const float *)gpuGetModelViewProjectionMatrix(NULL));
}
if (N) {
- #if DEBUG_MATRIX_BIND
+#if DEBUG_MATRIX_BIND
puts("setting normal matrix");
- #endif
+#endif
glUniformMatrix3fv(N->location, 1, GL_FALSE, (const float *)gpuGetNormalMatrix(NULL));
}
@@ -609,14 +609,14 @@ void gpuBindMatrices(const Gwn_ShaderInterface *shaderface)
Mat4 m;
gpuGetModelViewMatrix(m);
invert_m4(m);
- glUniformMatrix4fv(MV_inv->location, 1, GL_FALSE, (const float*) m);
+ glUniformMatrix4fv(MV_inv->location, 1, GL_FALSE, (const float *)m);
}
if (P_inv) {
Mat4 m;
gpuGetProjectionMatrix(m);
invert_m4(m);
- glUniformMatrix4fv(P_inv->location, 1, GL_FALSE, (const float*) m);
+ glUniformMatrix4fv(P_inv->location, 1, GL_FALSE, (const float *)m);
}
state.dirty = false;
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index 733aafd7362..66049b1d2a1 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -727,7 +727,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
[GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR] = { datatoc_gpu_shader_2D_image_vert_glsl,
datatoc_gpu_shader_image_shuffle_color_frag_glsl },
[GPU_SHADER_3D_UNIFORM_COLOR] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
- [GPU_SHADER_3D_UNIFORM_COLOR_U32] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
+ [GPU_SHADER_3D_UNIFORM_COLOR_U32] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
[GPU_SHADER_3D_FLAT_COLOR] = { datatoc_gpu_shader_3D_flat_color_vert_glsl,
datatoc_gpu_shader_flat_color_frag_glsl },
[GPU_SHADER_3D_FLAT_COLOR_U32] = { datatoc_gpu_shader_3D_flat_color_vert_glsl,
diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c
index 3defbe1e55f..6d52dab5a1f 100644
--- a/source/blender/gpu/intern/gpu_uniformbuffer.c
+++ b/source/blender/gpu/intern/gpu_uniformbuffer.c
@@ -243,8 +243,8 @@ static GPUType get_padded_gpu_type(LinkData *link)
/* Unless the vec3 is followed by a float we need to treat it as a vec4. */
if (gputype == GPU_VEC3 &&
- (link->next != NULL) &&
- (((GPUInput *)link->next->data)->type != GPU_FLOAT))
+ (link->next != NULL) &&
+ (((GPUInput *)link->next->data)->type != GPU_FLOAT))
{
gputype = GPU_VEC4;
}
@@ -368,7 +368,8 @@ int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo)
return ubo->bindpoint;
}
-void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo_) {
+void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo_)
+{
BLI_assert(ubo_->type == GPU_UBO_DYNAMIC);
GPUUniformBufferDynamic *ubo = (GPUUniformBufferDynamic *)ubo_;
ubo->flag |= GPU_UBO_FLAG_DIRTY;
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index bf255cfef6f..058f6ced40b 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -238,8 +238,8 @@ GPUTexture *GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine,
for (ViewportTempTexture *tmp_tex = viewport->tex_pool.first; tmp_tex; tmp_tex = tmp_tex->next) {
if ((GPU_texture_width(tmp_tex->texture) == width) &&
- (GPU_texture_height(tmp_tex->texture) == height) &&
- (GPU_texture_format(tmp_tex->texture) == format))
+ (GPU_texture_height(tmp_tex->texture) == height) &&
+ (GPU_texture_format(tmp_tex->texture) == format))
{
/* Search if the engine is not already using this texture */
for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; ++i) {