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:
authorEthan-Hall <Ethan1080>2022-03-23 17:53:10 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-03-23 22:06:12 +0300
commitf5066d43ae572de929fea31cbc9e091e288b2435 (patch)
treec585a7551aae6b899064e88b570046f606a76f7a /intern/cycles/kernel/svm
parent4e56e738a8f35228873d6e84d9e9f8b0e7a74a59 (diff)
Cleanup: use make_float4(f) zero_float4() to simplify code
Differential Revision: https://developer.blender.org/D14426
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r--intern/cycles/kernel/svm/image.h2
-rw-r--r--intern/cycles/kernel/svm/voronoi.h22
-rw-r--r--intern/cycles/kernel/svm/voxel.h2
3 files changed, 13 insertions, 13 deletions
diff --git a/intern/cycles/kernel/svm/image.h b/intern/cycles/kernel/svm/image.h
index e9669800f4c..31f29531740 100644
--- a/intern/cycles/kernel/svm/image.h
+++ b/intern/cycles/kernel/svm/image.h
@@ -186,7 +186,7 @@ ccl_device_noinline void svm_node_tex_image_box(KernelGlobals kg,
float3 co = stack_load_float3(stack, co_offset);
uint id = node.y;
- float4 f = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 f = zero_float4();
/* Map so that no textures are flipped, rotation is somewhat arbitrary. */
if (weight.x > 0.0f) {
diff --git a/intern/cycles/kernel/svm/voronoi.h b/intern/cycles/kernel/svm/voronoi.h
index 8afd7cc9b5f..4ff1047aab7 100644
--- a/intern/cycles/kernel/svm/voronoi.h
+++ b/intern/cycles/kernel/svm/voronoi.h
@@ -684,8 +684,8 @@ ccl_device void voronoi_f1_4d(float4 coord,
float4 localPosition = coord - cellPosition;
float minDistance = 8.0f;
- float4 targetOffset = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- float4 targetPosition = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 targetOffset = zero_float4();
+ float4 targetPosition = zero_float4();
for (int u = -1; u <= 1; u++) {
for (int k = -1; k <= 1; k++) {
ccl_loop_no_unroll for (int j = -1; j <= 1; j++)
@@ -724,7 +724,7 @@ ccl_device void voronoi_smooth_f1_4d(float4 coord,
float smoothDistance = 8.0f;
float3 smoothColor = make_float3(0.0f, 0.0f, 0.0f);
- float4 smoothPosition = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 smoothPosition = zero_float4();
for (int u = -2; u <= 2; u++) {
for (int k = -2; k <= 2; k++) {
ccl_loop_no_unroll for (int j = -2; j <= 2; j++)
@@ -765,10 +765,10 @@ ccl_device void voronoi_f2_4d(float4 coord,
float distanceF1 = 8.0f;
float distanceF2 = 8.0f;
- float4 offsetF1 = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- float4 positionF1 = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- float4 offsetF2 = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- float4 positionF2 = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 offsetF1 = zero_float4();
+ float4 positionF1 = zero_float4();
+ float4 offsetF2 = zero_float4();
+ float4 positionF2 = zero_float4();
for (int u = -1; u <= 1; u++) {
for (int k = -1; k <= 1; k++) {
ccl_loop_no_unroll for (int j = -1; j <= 1; j++)
@@ -808,7 +808,7 @@ ccl_device void voronoi_distance_to_edge_4d(float4 coord,
float4 cellPosition = floor(coord);
float4 localPosition = coord - cellPosition;
- float4 vectorToClosest = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 vectorToClosest = zero_float4();
float minDistance = 8.0f;
for (int u = -1; u <= 1; u++) {
for (int k = -1; k <= 1; k++) {
@@ -859,8 +859,8 @@ ccl_device void voronoi_n_sphere_radius_4d(float4 coord,
float4 cellPosition = floor(coord);
float4 localPosition = coord - cellPosition;
- float4 closestPoint = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
- float4 closestPointOffset = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 closestPoint = zero_float4();
+ float4 closestPointOffset = zero_float4();
float minDistance = 8.0f;
for (int u = -1; u <= 1; u++) {
for (int k = -1; k <= 1; k++) {
@@ -882,7 +882,7 @@ ccl_device void voronoi_n_sphere_radius_4d(float4 coord,
}
minDistance = 8.0f;
- float4 closestPointToClosestPoint = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 closestPointToClosestPoint = zero_float4();
for (int u = -1; u <= 1; u++) {
for (int k = -1; k <= 1; k++) {
ccl_loop_no_unroll for (int j = -1; j <= 1; j++)
diff --git a/intern/cycles/kernel/svm/voxel.h b/intern/cycles/kernel/svm/voxel.h
index c5f6a6f004a..553a00cd09a 100644
--- a/intern/cycles/kernel/svm/voxel.h
+++ b/intern/cycles/kernel/svm/voxel.h
@@ -30,7 +30,7 @@ ccl_device_noinline int svm_node_tex_voxel(
float4 r = kernel_tex_image_interp_3d(kg, id, co, INTERPOLATION_NONE);
#else
- float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ float4 r = zero_float4();
#endif
if (stack_valid(density_out_offset))
stack_store_float(stack, density_out_offset, r.w);