Commit: 633c2f07da2926e42f5bb5d43d16dd23767c498c
Author: Xavier Hallade
Date:   Thu Jun 23 18:30:49 2022 +0200
Branches: master
https://developer.blender.org/rB633c2f07da2926e42f5bb5d43d16dd23767c498c

Cyles: switch primitive.h inline hints to forceinline

This change helps decrease Intel GPU binaries compile time by 5-10
minutes without impacting other backends.

Reviewed By: sergey, brecht

Differential Revision: http://developer.blender.org/D15273

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

M       intern/cycles/kernel/geom/primitive.h

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

diff --git a/intern/cycles/kernel/geom/primitive.h 
b/intern/cycles/kernel/geom/primitive.h
index 9b4b61fbd84..0f1a3fc11bc 100644
--- a/intern/cycles/kernel/geom/primitive.h
+++ b/intern/cycles/kernel/geom/primitive.h
@@ -18,11 +18,11 @@ CCL_NAMESPACE_BEGIN
  * attributes for performance, mainly for GPU performance to avoid bringing in
  * heavy volume interpolation code. */
 
-ccl_device_inline float primitive_surface_attribute_float(KernelGlobals kg,
-                                                          ccl_private const 
ShaderData *sd,
-                                                          const 
AttributeDescriptor desc,
-                                                          ccl_private float 
*dx,
-                                                          ccl_private float 
*dy)
+ccl_device_forceinline float primitive_surface_attribute_float(KernelGlobals 
kg,
+                                                               ccl_private 
const ShaderData *sd,
+                                                               const 
AttributeDescriptor desc,
+                                                               ccl_private 
float *dx,
+                                                               ccl_private 
float *dy)
 {
   if (sd->type & PRIMITIVE_TRIANGLE) {
     if (subd_triangle_patch(kg, sd) == ~0)
@@ -49,11 +49,11 @@ ccl_device_inline float 
primitive_surface_attribute_float(KernelGlobals kg,
   }
 }
 
-ccl_device_inline float2 primitive_surface_attribute_float2(KernelGlobals kg,
-                                                            ccl_private const 
ShaderData *sd,
-                                                            const 
AttributeDescriptor desc,
-                                                            ccl_private float2 
*dx,
-                                                            ccl_private float2 
*dy)
+ccl_device_forceinline float2 primitive_surface_attribute_float2(KernelGlobals 
kg,
+                                                                 ccl_private 
const ShaderData *sd,
+                                                                 const 
AttributeDescriptor desc,
+                                                                 ccl_private 
float2 *dx,
+                                                                 ccl_private 
float2 *dy)
 {
   if (sd->type & PRIMITIVE_TRIANGLE) {
     if (subd_triangle_patch(kg, sd) == ~0)
@@ -80,11 +80,11 @@ ccl_device_inline float2 
primitive_surface_attribute_float2(KernelGlobals kg,
   }
 }
 
-ccl_device_inline float3 primitive_surface_attribute_float3(KernelGlobals kg,
-                                                            ccl_private const 
ShaderData *sd,
-                                                            const 
AttributeDescriptor desc,
-                                                            ccl_private float3 
*dx,
-                                                            ccl_private float3 
*dy)
+ccl_device_forceinline float3 primitive_surface_attribute_float3(KernelGlobals 
kg,
+                                                                 ccl_private 
const ShaderData *sd,
+                                                                 const 
AttributeDescriptor desc,
+                                                                 ccl_private 
float3 *dx,
+                                                                 ccl_private 
float3 *dy)
 {
   if (sd->type & PRIMITIVE_TRIANGLE) {
     if (subd_triangle_patch(kg, sd) == ~0)
@@ -149,15 +149,15 @@ ccl_device_forceinline float4 
primitive_surface_attribute_float4(KernelGlobals k
  * attributes for performance, mainly for GPU performance to avoid bringing in
  * heavy volume interpolation code. */
 
-ccl_device_inline bool primitive_is_volume_attribute(ccl_private const 
ShaderData *sd,
-                                                     const AttributeDescriptor 
desc)
+ccl_device_forceinline bool primitive_is_volume_attribute(ccl_private const 
ShaderData *sd,
+                                                          const 
AttributeDescriptor desc)
 {
   return sd->type == PRIMITIVE_VOLUME;
 }
 
-ccl_device_inline float primitive_volume_attribute_float(KernelGlobals kg,
-                                                         ccl_private const 
ShaderData *sd,
-                                                         const 
AttributeDescriptor desc)
+ccl_device_forceinline float primitive_volume_attribute_float(KernelGlobals kg,
+                                                              ccl_private 
const ShaderData *sd,
+                                                              const 
AttributeDescriptor desc)
 {
   if (primitive_is_volume_attribute(sd, desc)) {
     return volume_attribute_value_to_float(volume_attribute_float4(kg, sd, 
desc));
@@ -167,9 +167,9 @@ ccl_device_inline float 
primitive_volume_attribute_float(KernelGlobals kg,
   }
 }
 
-ccl_device_inline float3 primitive_volume_attribute_float3(KernelGlobals kg,
-                                                           ccl_private const 
ShaderData *sd,
-                                                           const 
AttributeDescriptor desc)
+ccl_device_forceinline float3 primitive_volume_attribute_float3(KernelGlobals 
kg,
+                                                                ccl_private 
const ShaderData *sd,
+                                                                const 
AttributeDescriptor desc)
 {
   if (primitive_is_volume_attribute(sd, desc)) {
     return volume_attribute_value_to_float3(volume_attribute_float4(kg, sd, 
desc));
@@ -179,9 +179,9 @@ ccl_device_inline float3 
primitive_volume_attribute_float3(KernelGlobals kg,
   }
 }
 
-ccl_device_inline float4 primitive_volume_attribute_float4(KernelGlobals kg,
-                                                           ccl_private const 
ShaderData *sd,
-                                                           const 
AttributeDescriptor desc)
+ccl_device_forceinline float4 primitive_volume_attribute_float4(KernelGlobals 
kg,
+                                                                ccl_private 
const ShaderData *sd,
+                                                                const 
AttributeDescriptor desc)
 {
   if (primitive_is_volume_attribute(sd, desc)) {
     return volume_attribute_float4(kg, sd, desc);
@@ -194,7 +194,7 @@ ccl_device_inline float4 
primitive_volume_attribute_float4(KernelGlobals kg,
 
 /* Default UV coordinate */
 
-ccl_device_inline float3 primitive_uv(KernelGlobals kg, ccl_private const 
ShaderData *sd)
+ccl_device_forceinline float3 primitive_uv(KernelGlobals kg, ccl_private const 
ShaderData *sd)
 {
   const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_UV);
 
@@ -262,8 +262,8 @@ ccl_device float3 primitive_tangent(KernelGlobals kg, 
ccl_private ShaderData *sd
 
 /* Motion vector for motion pass */
 
-ccl_device_inline float4 primitive_motion_vector(KernelGlobals kg,
-                                                 ccl_private const ShaderData 
*sd)
+ccl_device_forceinline float4 primitive_motion_vector(KernelGlobals kg,
+                                                      ccl_private const 
ShaderData *sd)
 {
   /* center position */
   float3 center;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to