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-05-01 14:14:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-01 14:41:07 +0300
commitc47d669f247d4762cfeede867c43c638e40c14c3 (patch)
tree734299c81811955ebb56f211bd010a39f42dc6ef /intern/cycles/render
parent177a0ca131794a15d775577e4fa25c1d9e695d13 (diff)
Cleanup: comments (long lines) in cycles
Diffstat (limited to 'intern/cycles/render')
-rw-r--r--intern/cycles/render/camera.cpp6
-rw-r--r--intern/cycles/render/denoising.cpp12
-rw-r--r--intern/cycles/render/denoising.h15
-rw-r--r--intern/cycles/render/mesh.cpp5
-rw-r--r--intern/cycles/render/shader.h6
-rw-r--r--intern/cycles/render/svm.cpp6
-rw-r--r--intern/cycles/render/tile.cpp31
7 files changed, 51 insertions, 30 deletions
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp
index a950324d4d4..baa3ce77f84 100644
--- a/intern/cycles/render/camera.cpp
+++ b/intern/cycles/render/camera.cpp
@@ -642,7 +642,8 @@ float Camera::world_to_raster_size(float3 P)
float3 D = normalize(Ddiff);
res = len(dist * dDdx - dot(dist * dDdx, D) * D);
- /* Decent approx distance to frustum (doesn't handle corners correctly, but not that big of a deal) */
+ /* Decent approx distance to frustum
+ * (doesn't handle corners correctly, but not that big of a deal) */
float f_dist = 0.0f;
if (offscreen_dicing_scale > 1.0f) {
@@ -686,7 +687,8 @@ float Camera::world_to_raster_size(float3 P)
f_dist = max(f_dist, *d);
}
else {
- /* Possibly far enough behind the frustum to use distance to origin instead of edge */
+ /* Possibly far enough behind the frustum to use distance to origin instead of edge
+ */
test_o = true;
}
}
diff --git a/intern/cycles/render/denoising.cpp b/intern/cycles/render/denoising.cpp
index c4f21d9c771..82bbfa5f823 100644
--- a/intern/cycles/render/denoising.cpp
+++ b/intern/cycles/render/denoising.cpp
@@ -69,8 +69,8 @@ static void print_progress(int num, int total, int frame, int num_frames)
fflush(stdout);
}
-/* Splits in at its last dot, setting suffix to the part after the dot and in to the part before it.
- * Returns whether a dot was found. */
+/* Splits in at its last dot, setting suffix to the part after the dot and in to the part before
+ * it. Returns whether a dot was found. */
static bool split_last_dot(string &in, string &suffix)
{
size_t pos = in.rfind(".");
@@ -84,9 +84,8 @@ static bool split_last_dot(string &in, string &suffix)
/* Separate channel names as generated by Blender.
* If views is true:
- * Inputs are expected in the form RenderLayer.Pass.View.Channel, sets renderlayer to "RenderLayer.View"
- * Otherwise:
- * Inputs are expected in the form RenderLayer.Pass.Channel */
+ * Inputs are expected in the form RenderLayer.Pass.View.Channel, sets renderlayer to
+ * "RenderLayer.View" Otherwise: Inputs are expected in the form RenderLayer.Pass.Channel */
static bool parse_channel_name(
string name, string &renderlayer, string &pass, string &channel, bool multiview_channels)
{
@@ -631,7 +630,8 @@ bool DenoiseImage::parse_channels(const ImageSpec &in_spec, string &error)
layer.name = name;
layer.samples = samples;
- /* If the sample value isn't set yet, check if there is a layer-specific one in the input file. */
+ /* If the sample value isn't set yet, check if there is a layer-specific one in the input file.
+ */
if (layer.samples < 1) {
string sample_string = in_spec.get_string_attribute("cycles." + name + ".samples", "");
if (sample_string != "") {
diff --git a/intern/cycles/render/denoising.h b/intern/cycles/render/denoising.h
index dcb842a4603..c234d00eb49 100644
--- a/intern/cycles/render/denoising.h
+++ b/intern/cycles/render/denoising.h
@@ -87,14 +87,17 @@ struct DenoiseImageLayer {
/* input_to_image_channel of the secondary frames, if any are used. */
vector<vector<int>> neighbor_input_to_image_channel;
- /* Write i-th channel of the processing output to output_to_image_channel[i]-th channel of the file. */
+ /* Write i-th channel of the processing output to output_to_image_channel[i]-th channel of the
+ * file. */
vector<int> output_to_image_channel;
- /* Detect whether this layer contains a full set of channels and set up the offsets accordingly. */
+ /* Detect whether this layer contains a full set of channels and set up the offsets accordingly.
+ */
bool detect_denoising_channels();
/* Map the channels of a secondary frame to the channels that are required for processing,
- * fill neighbor_input_to_image_channel if all are present or return false if a channel are missing. */
+ * fill neighbor_input_to_image_channel if all are present or return false if a channel are
+ * missing. */
bool match_channels(int neighbor,
const std::vector<string> &channelnames,
const std::vector<string> &neighbor_channelnames);
@@ -125,7 +128,8 @@ class DenoiseImage {
void free();
- /* Open the input image, parse its channels, open the output image and allocate the output buffer. */
+ /* Open the input image, parse its channels, open the output image and allocate the output
+ * buffer. */
bool load(const string &in_filepath, string &error);
/* Load neighboring frames. */
@@ -139,7 +143,8 @@ class DenoiseImage {
bool save_output(const string &out_filepath, string &error);
protected:
- /* Parse input file channels, separate them into DenoiseImageLayers, detect DenoiseImageLayers with full channel sets,
+ /* Parse input file channels, separate them into DenoiseImageLayers,
+ * detect DenoiseImageLayers with full channel sets,
* fill layers and set up the output channels and passthrough map. */
bool parse_channels(const ImageSpec &in_spec, string &error);
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index 54dacf5d1f4..f1622493455 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -839,8 +839,9 @@ void Mesh::add_undisplaced()
size_t size = attr->buffer_size(
this, (subdivision_type == SUBDIVISION_NONE) ? ATTR_PRIM_TRIANGLE : ATTR_PRIM_SUBD);
- /* Center points for ngons aren't stored in Mesh::verts but are included in size since they will be
- * calculated later, we subtract them from size here so we don't have an overflow while copying.
+ /* Center points for ngons aren't stored in Mesh::verts but are included in size since they will
+ * be calculated later, we subtract them from size here so we don't have an overflow while
+ * copying.
*/
size -= num_ngons * attr->data_sizeof();
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index 600b0cc59d4..f74204df355 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -143,8 +143,10 @@ class Shader : public Node {
Shader();
~Shader();
- /* Checks whether the shader consists of just a emission node with fixed inputs that's connected directly to the output.
- * If yes, it sets the content of emission to the constant value (color * strength), which is then used for speeding up light evaluation. */
+ /* Checks whether the shader consists of just a emission node with fixed inputs that's connected
+ * directly to the output.
+ * If yes, it sets the content of emission to the constant value (color * strength), which is
+ * then used for speeding up light evaluation. */
bool is_constant_emission(float3 *emission);
void set_graph(ShaderGraph *graph);
diff --git a/intern/cycles/render/svm.cpp b/intern/cycles/render/svm.cpp
index d8e3e24f39e..040aa074f28 100644
--- a/intern/cycles/render/svm.cpp
+++ b/intern/cycles/render/svm.cpp
@@ -773,7 +773,8 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty
compile_failed = false;
}
- /* for bump shaders we fall thru to the surface shader, but if this is any other kind of shader it ends here */
+ /* for bump shaders we fall thru to the surface shader, but if this is any other kind of shader
+ * it ends here */
if (type != SHADER_TYPE_BUMP) {
add_node(NODE_END, 0, 0, 0);
}
@@ -828,7 +829,8 @@ void SVMCompiler::compile(
{
scoped_timer timer((summary != NULL) ? &summary->time_generate_surface : NULL);
compile_type(shader, shader->graph, SHADER_TYPE_SURFACE);
- /* only set jump offset if there's no bump shader, as the bump shader will fall thru to this one if it exists */
+ /* only set jump offset if there's no bump shader, as the bump shader will fall thru to this
+ * one if it exists */
if (!has_bump) {
svm_nodes[index].y = svm_nodes.size();
}
diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp
index 3148b5ef664..9ef0c695667 100644
--- a/intern/cycles/render/tile.cpp
+++ b/intern/cycles/render/tile.cpp
@@ -170,8 +170,9 @@ void TileManager::set_samples(int num_samples_)
}
else {
uint64_t pixel_samples = 0;
- /* While rendering in the viewport, the initial preview resolution is increased to the native resolution
- * before the actual rendering begins. Therefore, additional pixel samples will be rendered. */
+ /* While rendering in the viewport, the initial preview resolution is increased to the native
+ * resolution before the actual rendering begins. Therefore, additional pixel samples will be
+ * rendered. */
int divider = max(get_divider(params.width, params.height, start_resolution) / 2, pixel_size);
while (divider > pixel_size) {
int image_w = max(1, params.width / divider);
@@ -190,8 +191,9 @@ void TileManager::set_samples(int num_samples_)
}
}
-/* If sliced is false, splits image into tiles and assigns equal amount of tiles to every render device.
- * If sliced is true, slice image into as much pieces as how many devices are rendering this image. */
+/* If sliced is false, splits image into tiles and assigns equal amount of tiles to every render
+ * device. If sliced is true, slice image into as much pieces as how many devices are rendering
+ * this image. */
int TileManager::gen_tiles(bool sliced)
{
int resolution = state.resolution_divider;
@@ -255,7 +257,8 @@ int TileManager::gen_tiles(bool sliced)
}
int2 pos = block * block_size + tile * tile_size + offset;
- /* Only add tiles which are in the image (tiles outside of the image can be generated since the spiral is always square). */
+ /* Only add tiles which are in the image (tiles outside of the image can be generated since
+ * the spiral is always square). */
if (pos.x >= 0 && pos.y >= 0 && pos.x < image_w && pos.y < image_h) {
int w = min(tile_size.x, image_w - pos.x);
int h = min(tile_size.y, image_h - pos.y);
@@ -336,7 +339,8 @@ int TileManager::gen_tiles(bool sliced)
cur_tiles++;
if (cur_tiles == tiles_per_device) {
- /* Tiles are already generated in Bottom-to-Top order, so no sort is necessary in that case. */
+ /* Tiles are already generated in Bottom-to-Top order, so no sort is necessary in that
+ * case. */
if (tile_order != TILE_BOTTOM_TO_TOP) {
tile_list->sort(TileComparator(tile_order, center, &state.tiles[0]));
}
@@ -398,7 +402,8 @@ int TileManager::get_neighbor_index(int index, int neighbor)
return ny * state.tile_stride + nx;
}
-/* Checks whether all neighbors of a tile (as well as the tile itself) are at least at state min_state. */
+/* Checks whether all neighbors of a tile (as well as the tile itself) are at least at state
+ * min_state. */
bool TileManager::check_neighbor_state(int index, Tile::State min_state)
{
if (index < 0 || state.tiles[index].state < min_state) {
@@ -415,7 +420,8 @@ bool TileManager::check_neighbor_state(int index, Tile::State min_state)
return true;
}
-/* Returns whether the tile should be written (and freed if no denoising is used) instead of updating. */
+/* Returns whether the tile should be written (and freed if no denoising is used) instead of
+ * updating. */
bool TileManager::finish_tile(int index, bool &delete_tile)
{
delete_tile = false;
@@ -432,7 +438,8 @@ bool TileManager::finish_tile(int index, bool &delete_tile)
return true;
}
state.tiles[index].state = Tile::RENDERED;
- /* For each neighbor and the tile itself, check whether all of its neighbors have been rendered. If yes, it can be denoised. */
+ /* For each neighbor and the tile itself, check whether all of its neighbors have been
+ * rendered. If yes, it can be denoised. */
for (int neighbor = 0; neighbor < 9; neighbor++) {
int nindex = get_neighbor_index(index, neighbor);
if (check_neighbor_state(nindex, Tile::RENDERED)) {
@@ -444,13 +451,15 @@ bool TileManager::finish_tile(int index, bool &delete_tile)
}
case Tile::DENOISE: {
state.tiles[index].state = Tile::DENOISED;
- /* For each neighbor and the tile itself, check whether all of its neighbors have been denoised. If yes, it can be freed. */
+ /* For each neighbor and the tile itself, check whether all of its neighbors have been
+ * denoised. If yes, it can be freed. */
for (int neighbor = 0; neighbor < 9; neighbor++) {
int nindex = get_neighbor_index(index, neighbor);
if (check_neighbor_state(nindex, Tile::DENOISED)) {
state.tiles[nindex].state = Tile::DONE;
/* It can happen that the tile just finished denoising and already can be freed here.
- * However, in that case it still has to be written before deleting, so we can't delete it yet. */
+ * However, in that case it still has to be written before deleting, so we can't delete
+ * it yet. */
if (neighbor == 8) {
delete_tile = true;
}