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>2019-04-21 18:45:43 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-21 23:30:08 +0300
commitc5862e0a06b75767fd863673c54aab54f27d1872 (patch)
tree859b364533455278eb73fb39e3ebf33996d250cc /source/blender/gpu/intern
parent024d40b504e4dc2a23824021bdcfe772a1f5f670 (diff)
Cleanup: comments (long lines) in gpu
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_attr_binding.c3
-rw-r--r--source/blender/gpu/intern/gpu_batch.c3
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c3
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.c3
-rw-r--r--source/blender/gpu/intern/gpu_immediate.c4
-rw-r--r--source/blender/gpu/intern/gpu_select.c6
-rw-r--r--source/blender/gpu/intern/gpu_select_pick.c3
-rw-r--r--source/blender/gpu/intern/gpu_shader.c11
-rw-r--r--source/blender/gpu/intern/gpu_texture.c7
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c3
10 files changed, 29 insertions, 17 deletions
diff --git a/source/blender/gpu/intern/gpu_attr_binding.c b/source/blender/gpu/intern/gpu_attr_binding.c
index 6cd350df505..e280b77f661 100644
--- a/source/blender/gpu/intern/gpu_attr_binding.c
+++ b/source/blender/gpu/intern/gpu_attr_binding.c
@@ -73,7 +73,8 @@ void get_attr_locations(const GPUVertFormat *format,
const GPUShaderInput *input = GPU_shaderinterface_attr(shaderface, a->name[n_idx]);
#if TRUST_NO_ONE
assert(input != NULL);
- /* TODO: make this a recoverable runtime error? indicates mismatch between vertex format and program */
+ /* TODO: make this a recoverable runtime error?
+ * indicates mismatch between vertex format and program. */
#endif
write_attr_location(binding, a_idx, input->location);
}
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index 636a48c1623..4f5215ce9e6 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -420,7 +420,8 @@ static void batch_update_program_bindings(GPUBatch *batch, uint v_first)
void GPU_batch_program_use_begin(GPUBatch *batch)
{
/* NOTE: use_program & done_using_program are fragile, depend on staying in sync with
- * the GL context's active program. use_program doesn't mark other programs as "not used". */
+ * the GL context's active program.
+ * use_program doesn't mark other programs as "not used". */
/* TODO: make not fragile (somehow) */
if (!batch->program_in_use) {
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 242544ec07f..43211fe0969 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -824,7 +824,8 @@ static char *code_generate_fragment(GPUMaterial *material,
BLI_dynstr_append(ds, "}\n");
- /* XXX This cannot go into gpu_shader_material.glsl because main() would be parsed and generate error */
+ /* XXX This cannot go into gpu_shader_material.glsl because main()
+ * would be parsed and generate error */
/* Old glsl mode compat. */
BLI_dynstr_append(ds, "#ifndef NODETREE_EXEC\n");
BLI_dynstr_append(ds, "out vec4 fragColor;\n");
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index dbe1d2c8d69..a77f9ca5f11 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -717,7 +717,8 @@ void GPU_framebuffer_blit(GPUFrameBuffer *fb_read,
/**
* Use this if you need to custom downsample your texture and use the previous mip level as input.
- * This function only takes care of the correct texture handling. It execute the callback for each texture level.
+ * This function only takes care of the correct texture handling.
+ * It execute the callback for each texture level.
*/
void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *fb,
int max_lvl,
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 3c8b76dd36c..11c4cfba8df 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -634,7 +634,9 @@ static void immEndVertex(void) /* and move on to the next vertex */
if ((imm.unassigned_attr_bits >> a_idx) & 1) {
const GPUVertAttr *a = &imm.vertex_format.attrs[a_idx];
- /* printf("copying %s from vertex %u to %u\n", a->name, imm.vertex_idx - 1, imm.vertex_idx); */
+#if 0
+ printf("copying %s from vertex %u to %u\n", a->name, imm.vertex_idx - 1, imm.vertex_idx);
+#endif
GLubyte *data = imm.vertex_data + a->offset;
memcpy(data, data - imm.vertex_format.stride, a->sz);
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index 4cfedc0708b..4268af2198d 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -69,7 +69,8 @@ static GPUSelectState g_select_state = {0};
void GPU_select_begin(uint *buffer, uint bufsize, const rcti *input, char mode, int oldhits)
{
if (mode == GPU_SELECT_NEAREST_SECOND_PASS) {
- /* In the case hits was '-1', don't start the second pass since it's not going to give useful results.
+ /* In the case hits was '-1',
+ * don't start the second pass since it's not going to give useful results.
* As well as buffer overflow in 'gpu_select_query_load_id'. */
BLI_assert(oldhits != -1);
}
@@ -99,7 +100,8 @@ void GPU_select_begin(uint *buffer, uint bufsize, const rcti *input, char mode,
}
/**
- * loads a new selection id and ends previous query, if any. In second pass of selection it also returns
+ * loads a new selection id and ends previous query, if any.
+ * In second pass of selection it also returns
* if id has been hit on the first pass already.
* Thus we can skip drawing un-hit objects.
*
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index 253c8703234..6c3e05912b0 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -318,7 +318,8 @@ void gpu_select_pick_begin(uint (*buffer)[4], uint bufsize, const rcti *input, c
if (mode == GPU_SELECT_PICK_ALL) {
/* Note that other depth settings (such as #GL_LEQUAL) work too,
* since the depth is always cleared.
- * Noting this for cases when depth picking is used where drawing calls change depth settings. */
+ * Noting this for cases when depth picking is used where
+ * drawing calls change depth settings. */
glDepthFunc(GL_ALWAYS);
}
else {
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index dd8035e2618..5fe23824ce2 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -557,10 +557,10 @@ static const char *string_join_array_maybe_alloc(const char **str_arr, bool *r_i
* Example:
* \code{.c}
* sh = GPU_shader_create_from_arrays({
- * .vert = (const char *[]){shader_lib_glsl, shader_vert_glsl, NULL},
- * .geom = (const char *[]){shader_geom_glsl, NULL},
- * .frag = (const char *[]){shader_frag_glsl, NULL},
- * .defs = (const char *[]){"#define DEFINE\n", test ? "#define OTHER_DEFINE\n" : "", NULL},
+ * .vert = (const char *[]){shader_lib_glsl, shader_vert_glsl, NULL},
+ * .geom = (const char *[]){shader_geom_glsl, NULL},
+ * .frag = (const char *[]){shader_frag_glsl, NULL},
+ * .defs = (const char *[]){"#define DEFINE\n", test ? "#define OTHER_DEFINE\n" : "", NULL},
* });
* \endcode
*/
@@ -1297,7 +1297,8 @@ GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader,
}
}
else if (shader == GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR) {
- /* Dashed need geometry shader, which are not supported by legacy OpenGL, fallback to solid lines. */
+ /* Dashed need geometry shader, which are not supported by legacy OpenGL,
+ * fallback to solid lines. */
/* TODO: remove after switch to core profile (maybe) */
if (!GLEW_VERSION_3_2) {
stages_legacy.vert = datatoc_gpu_shader_3D_line_dashed_uniform_color_legacy_vert_glsl;
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index afe5e381334..e1a4357467c 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -43,8 +43,8 @@
#include "gpu_context_private.h"
static struct GPUTextureGlobal {
- GPUTexture *
- invalid_tex_1D; /* texture used in place of invalid textures (not loaded correctly, missing) */
+ /** Texture used in place of invalid textures (not loaded correctly, missing). */
+ GPUTexture *invalid_tex_1D;
GPUTexture *invalid_tex_2D;
GPUTexture *invalid_tex_3D;
} GG = {NULL, NULL, NULL};
@@ -1598,7 +1598,8 @@ void GPU_texture_generate_mipmap(GPUTexture *tex)
if (GPU_texture_depth(tex)) {
/* Some drivers have bugs when using glGenerateMipmap with depth textures (see T56789).
* In this case we just create a complete texture with mipmaps manually without downsampling.
- * You must initialize the texture levels using other methods like GPU_framebuffer_recursive_downsample(). */
+ * You must initialize the texture levels using other methods like
+ * GPU_framebuffer_recursive_downsample(). */
int levels = 1 + floor(log2(max_ii(tex->w, tex->h)));
eGPUDataFormat data_format = gpu_get_data_format_from_tex_format(tex->format);
for (int i = 1; i < levels; ++i) {
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index 74c2959ee00..b57be9fdf37 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -265,7 +265,8 @@ void GPU_viewport_size_get(const GPUViewport *viewport, int size[2])
/**
* Special case, this is needed for when we have a viewport without a frame-buffer output
- * (occlusion queries for eg) but still need to set the size since it may be used for other calculations.
+ * (occlusion queries for eg)
+ * but still need to set the size since it may be used for other calculations.
*/
void GPU_viewport_size_set(GPUViewport *viewport, const int size[2])
{