[Bf-blender-cvs] [ba3096208dd] temp-angavrilov-material-uniforms: Cycles: rename uchar4 attribute accessors from 'float4' to 'uchar4'.

Alexander Gavrilov noreply at git.blender.org
Mon Oct 12 13:15:34 CEST 2020


Commit: ba3096208ddf57414e159e39fbbed0aa7008dbfa
Author: Alexander Gavrilov
Date:   Tue Aug 4 16:37:46 2020 +0300
Branches: temp-angavrilov-material-uniforms
https://developer.blender.org/rBba3096208ddf57414e159e39fbbed0aa7008dbfa

Cycles: rename uchar4 attribute accessors from 'float4' to 'uchar4'.

===================================================================

M	intern/cycles/kernel/geom/geom_primitive.h
M	intern/cycles/kernel/geom/geom_subd_triangle.h
M	intern/cycles/kernel/geom/geom_triangle.h
M	intern/cycles/kernel/osl/osl_services.cpp
M	intern/cycles/kernel/svm/svm_attribute.h
M	intern/cycles/kernel/svm/svm_vertex_color.h

===================================================================

diff --git a/intern/cycles/kernel/geom/geom_primitive.h b/intern/cycles/kernel/geom/geom_primitive.h
index 997abf438d0..f8f4674e102 100644
--- a/intern/cycles/kernel/geom/geom_primitive.h
+++ b/intern/cycles/kernel/geom/geom_primitive.h
@@ -162,7 +162,7 @@ ccl_device_inline float3 primitive_attribute_float3(KernelGlobals *kg,
   }
 }
 
-ccl_device_inline float4 primitive_attribute_float4(KernelGlobals *kg,
+ccl_device_inline float4 primitive_attribute_uchar4(KernelGlobals *kg,
                                                     const ShaderData *sd,
                                                     const AttributeDescriptor desc,
                                                     float4 *dx,
@@ -170,9 +170,9 @@ ccl_device_inline float4 primitive_attribute_float4(KernelGlobals *kg,
 {
   if (sd->type & PRIMITIVE_ALL_TRIANGLE) {
     if (subd_triangle_patch(kg, sd) == ~0)
-      return triangle_attribute_float4(kg, sd, desc, dx, dy);
+      return triangle_attribute_uchar4(kg, sd, desc, dx, dy);
     else
-      return subd_triangle_attribute_float4(kg, sd, desc, dx, dy);
+      return subd_triangle_attribute_uchar4(kg, sd, desc, dx, dy);
   }
 #ifdef __HAIR__
   else if (sd->type & PRIMITIVE_ALL_CURVE) {
diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h b/intern/cycles/kernel/geom/geom_subd_triangle.h
index 3eef9857ae3..1d69c1666f6 100644
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h
@@ -520,7 +520,7 @@ ccl_device_noinline float3 subd_triangle_attribute_float3(KernelGlobals *kg,
   }
 }
 
-ccl_device_noinline float4 subd_triangle_attribute_float4(KernelGlobals *kg,
+ccl_device_noinline float4 subd_triangle_attribute_uchar4(KernelGlobals *kg,
                                                           const ShaderData *sd,
                                                           const AttributeDescriptor desc,
                                                           float4 *dx,
diff --git a/intern/cycles/kernel/geom/geom_triangle.h b/intern/cycles/kernel/geom/geom_triangle.h
index 0278f3ade8e..7fb3c9c013e 100644
--- a/intern/cycles/kernel/geom/geom_triangle.h
+++ b/intern/cycles/kernel/geom/geom_triangle.h
@@ -306,7 +306,7 @@ ccl_device float3 triangle_attribute_float3(KernelGlobals *kg,
   }
 }
 
-ccl_device float4 triangle_attribute_float4(KernelGlobals *kg,
+ccl_device float4 triangle_attribute_uchar4(KernelGlobals *kg,
                                             const ShaderData *sd,
                                             const AttributeDescriptor desc,
                                             float4 *dx,
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
index aee1e3a244e..74cbb80f59e 100644
--- a/intern/cycles/kernel/osl/osl_services.cpp
+++ b/intern/cycles/kernel/osl/osl_services.cpp
@@ -693,7 +693,7 @@ static bool get_primitive_attribute(KernelGlobals *kg,
   }
   else if (attr.type == TypeRGBA) {
     float4 fval[3];
-    fval[0] = primitive_attribute_float4(
+    fval[0] = primitive_attribute_uchar4(
         kg, sd, attr.desc, (derivatives) ? &fval[1] : NULL, (derivatives) ? &fval[2] : NULL);
     return set_attribute_float4(fval, type, derivatives, val);
   }
diff --git a/intern/cycles/kernel/svm/svm_attribute.h b/intern/cycles/kernel/svm/svm_attribute.h
index fc7a3ba3f5a..a947c541333 100644
--- a/intern/cycles/kernel/svm/svm_attribute.h
+++ b/intern/cycles/kernel/svm/svm_attribute.h
@@ -70,7 +70,7 @@ ccl_device void svm_node_attr(KernelGlobals *kg, ShaderData *sd, float *stack, u
     }
   }
   else if (desc.type == NODE_ATTR_RGBA) {
-    float4 f = primitive_attribute_float4(kg, sd, desc, NULL, NULL);
+    float4 f = primitive_attribute_uchar4(kg, sd, desc, NULL, NULL);
     if (type == NODE_ATTR_FLOAT) {
       stack_store_float(stack, out_offset, average(float4_to_float3(f)));
     }
@@ -118,7 +118,7 @@ ccl_device void svm_node_attr_bump_dx(KernelGlobals *kg, ShaderData *sd, float *
   }
   else if (desc.type == NODE_ATTR_RGBA) {
     float4 dx;
-    float4 f = primitive_attribute_float4(kg, sd, desc, &dx, NULL);
+    float4 f = primitive_attribute_uchar4(kg, sd, desc, &dx, NULL);
     if (type == NODE_ATTR_FLOAT) {
       stack_store_float(stack, out_offset, average(float4_to_float3(f + dx)));
     }
@@ -167,7 +167,7 @@ ccl_device void svm_node_attr_bump_dy(KernelGlobals *kg, ShaderData *sd, float *
   }
   else if (desc.type == NODE_ATTR_RGBA) {
     float4 dy;
-    float4 f = primitive_attribute_float4(kg, sd, desc, NULL, &dy);
+    float4 f = primitive_attribute_uchar4(kg, sd, desc, NULL, &dy);
     if (type == NODE_ATTR_FLOAT) {
       stack_store_float(stack, out_offset, average(float4_to_float3(f + dy)));
     }
diff --git a/intern/cycles/kernel/svm/svm_vertex_color.h b/intern/cycles/kernel/svm/svm_vertex_color.h
index 3c105b1cbfa..7d3aa5d71a3 100644
--- a/intern/cycles/kernel/svm/svm_vertex_color.h
+++ b/intern/cycles/kernel/svm/svm_vertex_color.h
@@ -25,7 +25,7 @@ ccl_device void svm_node_vertex_color(KernelGlobals *kg,
 {
   AttributeDescriptor descriptor = find_attribute(kg, sd, layer_id);
   if (descriptor.offset != ATTR_STD_NOT_FOUND) {
-    float4 vertex_color = primitive_attribute_float4(kg, sd, descriptor, NULL, NULL);
+    float4 vertex_color = primitive_attribute_uchar4(kg, sd, descriptor, NULL, NULL);
     stack_store_float3(stack, color_offset, float4_to_float3(vertex_color));
     stack_store_float(stack, alpha_offset, vertex_color.w);
   }
@@ -51,7 +51,7 @@ ccl_device_noinline
   AttributeDescriptor descriptor = find_attribute(kg, sd, layer_id);
   if (descriptor.offset != ATTR_STD_NOT_FOUND) {
     float4 dx;
-    float4 vertex_color = primitive_attribute_float4(kg, sd, descriptor, &dx, NULL);
+    float4 vertex_color = primitive_attribute_uchar4(kg, sd, descriptor, &dx, NULL);
     vertex_color += dx;
     stack_store_float3(stack, color_offset, float4_to_float3(vertex_color));
     stack_store_float(stack, alpha_offset, vertex_color.w);
@@ -78,7 +78,7 @@ ccl_device_noinline
   AttributeDescriptor descriptor = find_attribute(kg, sd, layer_id);
   if (descriptor.offset != ATTR_STD_NOT_FOUND) {
     float4 dy;
-    float4 vertex_color = primitive_attribute_float4(kg, sd, descriptor, NULL, &dy);
+    float4 vertex_color = primitive_attribute_uchar4(kg, sd, descriptor, NULL, &dy);
     vertex_color += dy;
     stack_store_float3(stack, color_offset, float4_to_float3(vertex_color));
     stack_store_float(stack, alpha_offset, vertex_color.w);



More information about the Bf-blender-cvs mailing list