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:
authorBrecht Van Lommel <brecht>2021-10-17 17:10:10 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-10-18 20:02:10 +0300
commit1df3b51988852fa8ee6b530a64aa23346db9acd4 (patch)
treedd79dba4c8ff8bb8474cc399e9d1b308d845e0cb /intern/cycles/kernel/geom
parent44c3bb729be42d6d67eaf8918d7cbcb2ff0b315d (diff)
Cycles: replace integrator state argument macros
* Rename struct KernelGlobals to struct KernelGlobalsCPU * Add KernelGlobals, IntegratorState and ConstIntegratorState typedefs that every device can define in its own way. * Remove INTEGRATOR_STATE_ARGS and INTEGRATOR_STATE_PASS macros and replace with these new typedefs. * Add explicit state argument to INTEGRATOR_STATE and similar macros In preparation for decoupling main and shadow paths. Differential Revision: https://developer.blender.org/D12888
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r--intern/cycles/kernel/geom/geom_attribute.h12
-rw-r--r--intern/cycles/kernel/geom/geom_curve.h17
-rw-r--r--intern/cycles/kernel/geom/geom_curve_intersect.h4
-rw-r--r--intern/cycles/kernel/geom/geom_motion_curve.h15
-rw-r--r--intern/cycles/kernel/geom/geom_motion_triangle.h15
-rw-r--r--intern/cycles/kernel/geom/geom_motion_triangle_intersect.h8
-rw-r--r--intern/cycles/kernel/geom/geom_motion_triangle_shader.h2
-rw-r--r--intern/cycles/kernel/geom/geom_object.h89
-rw-r--r--intern/cycles/kernel/geom/geom_patch.h18
-rw-r--r--intern/cycles/kernel/geom/geom_primitive.h32
-rw-r--r--intern/cycles/kernel/geom/geom_shader_data.h13
-rw-r--r--intern/cycles/kernel/geom/geom_subd_triangle.h24
-rw-r--r--intern/cycles/kernel/geom/geom_triangle.h29
-rw-r--r--intern/cycles/kernel/geom/geom_triangle_intersect.h8
-rw-r--r--intern/cycles/kernel/geom/geom_volume.h4
15 files changed, 129 insertions, 161 deletions
diff --git a/intern/cycles/kernel/geom/geom_attribute.h b/intern/cycles/kernel/geom/geom_attribute.h
index 850ac44e6e0..848e0430caa 100644
--- a/intern/cycles/kernel/geom/geom_attribute.h
+++ b/intern/cycles/kernel/geom/geom_attribute.h
@@ -27,11 +27,9 @@ CCL_NAMESPACE_BEGIN
* Lookup of attributes is different between OSL and SVM, as OSL is ustring
* based while for SVM we use integer ids. */
-ccl_device_inline uint subd_triangle_patch(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd);
+ccl_device_inline uint subd_triangle_patch(KernelGlobals kg, ccl_private const ShaderData *sd);
-ccl_device_inline uint attribute_primitive_type(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device_inline uint attribute_primitive_type(KernelGlobals kg, ccl_private const ShaderData *sd)
{
if ((sd->type & PRIMITIVE_ALL_TRIANGLE) && subd_triangle_patch(kg, sd) != ~0) {
return ATTR_PRIM_SUBD;
@@ -50,12 +48,12 @@ ccl_device_inline AttributeDescriptor attribute_not_found()
/* Find attribute based on ID */
-ccl_device_inline uint object_attribute_map_offset(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline uint object_attribute_map_offset(KernelGlobals kg, int object)
{
return kernel_tex_fetch(__objects, object).attribute_map_offset;
}
-ccl_device_inline AttributeDescriptor find_attribute(ccl_global const KernelGlobals *kg,
+ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals kg,
ccl_private const ShaderData *sd,
uint id)
{
@@ -102,7 +100,7 @@ ccl_device_inline AttributeDescriptor find_attribute(ccl_global const KernelGlob
/* Transform matrix attribute on meshes */
-ccl_device Transform primitive_attribute_matrix(ccl_global const KernelGlobals *kg,
+ccl_device Transform primitive_attribute_matrix(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc)
{
diff --git a/intern/cycles/kernel/geom/geom_curve.h b/intern/cycles/kernel/geom/geom_curve.h
index 07f218d781b..7271193eef8 100644
--- a/intern/cycles/kernel/geom/geom_curve.h
+++ b/intern/cycles/kernel/geom/geom_curve.h
@@ -27,7 +27,7 @@ CCL_NAMESPACE_BEGIN
/* Reading attributes on various curve elements */
-ccl_device float curve_attribute_float(ccl_global const KernelGlobals *kg,
+ccl_device float curve_attribute_float(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float *dx,
@@ -69,7 +69,7 @@ ccl_device float curve_attribute_float(ccl_global const KernelGlobals *kg,
}
}
-ccl_device float2 curve_attribute_float2(ccl_global const KernelGlobals *kg,
+ccl_device float2 curve_attribute_float2(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float2 *dx,
@@ -115,7 +115,7 @@ ccl_device float2 curve_attribute_float2(ccl_global const KernelGlobals *kg,
}
}
-ccl_device float3 curve_attribute_float3(ccl_global const KernelGlobals *kg,
+ccl_device float3 curve_attribute_float3(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float3 *dx,
@@ -157,7 +157,7 @@ ccl_device float3 curve_attribute_float3(ccl_global const KernelGlobals *kg,
}
}
-ccl_device float4 curve_attribute_float4(ccl_global const KernelGlobals *kg,
+ccl_device float4 curve_attribute_float4(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float4 *dx,
@@ -201,8 +201,7 @@ ccl_device float4 curve_attribute_float4(ccl_global const KernelGlobals *kg,
/* Curve thickness */
-ccl_device float curve_thickness(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device float curve_thickness(KernelGlobals kg, ccl_private const ShaderData *sd)
{
float r = 0.0f;
@@ -230,8 +229,7 @@ ccl_device float curve_thickness(ccl_global const KernelGlobals *kg,
/* Curve location for motion pass, linear interpolation between keys and
* ignoring radius because we do the same for the motion keys */
-ccl_device float3 curve_motion_center_location(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device float3 curve_motion_center_location(KernelGlobals kg, ccl_private const ShaderData *sd)
{
KernelCurve curve = kernel_tex_fetch(__curves, sd->prim);
int k0 = curve.first_key + PRIMITIVE_UNPACK_SEGMENT(sd->type);
@@ -247,8 +245,7 @@ ccl_device float3 curve_motion_center_location(ccl_global const KernelGlobals *k
/* Curve tangent normal */
-ccl_device float3 curve_tangent_normal(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device float3 curve_tangent_normal(KernelGlobals kg, ccl_private const ShaderData *sd)
{
float3 tgN = make_float3(0.0f, 0.0f, 0.0f);
diff --git a/intern/cycles/kernel/geom/geom_curve_intersect.h b/intern/cycles/kernel/geom/geom_curve_intersect.h
index 04af8ea1421..fb0b80b281f 100644
--- a/intern/cycles/kernel/geom/geom_curve_intersect.h
+++ b/intern/cycles/kernel/geom/geom_curve_intersect.h
@@ -625,7 +625,7 @@ ccl_device_inline bool ribbon_intersect(const float3 ray_org,
return false;
}
-ccl_device_forceinline bool curve_intersect(ccl_global const KernelGlobals *kg,
+ccl_device_forceinline bool curve_intersect(KernelGlobals kg,
ccl_private Intersection *isect,
const float3 P,
const float3 dir,
@@ -679,7 +679,7 @@ ccl_device_forceinline bool curve_intersect(ccl_global const KernelGlobals *kg,
}
}
-ccl_device_inline void curve_shader_setup(ccl_global const KernelGlobals *kg,
+ccl_device_inline void curve_shader_setup(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
diff --git a/intern/cycles/kernel/geom/geom_motion_curve.h b/intern/cycles/kernel/geom/geom_motion_curve.h
index 5754608a69b..2dd213d43f6 100644
--- a/intern/cycles/kernel/geom/geom_motion_curve.h
+++ b/intern/cycles/kernel/geom/geom_motion_curve.h
@@ -27,7 +27,7 @@ CCL_NAMESPACE_BEGIN
#ifdef __HAIR__
-ccl_device_inline void motion_curve_keys_for_step_linear(ccl_global const KernelGlobals *kg,
+ccl_device_inline void motion_curve_keys_for_step_linear(KernelGlobals kg,
int offset,
int numkeys,
int numsteps,
@@ -54,13 +54,8 @@ ccl_device_inline void motion_curve_keys_for_step_linear(ccl_global const Kernel
}
/* return 2 curve key locations */
-ccl_device_inline void motion_curve_keys_linear(ccl_global const KernelGlobals *kg,
- int object,
- int prim,
- float time,
- int k0,
- int k1,
- float4 keys[2])
+ccl_device_inline void motion_curve_keys_linear(
+ KernelGlobals kg, int object, int prim, float time, int k0, int k1, float4 keys[2])
{
/* get motion info */
int numsteps, numkeys;
@@ -86,7 +81,7 @@ ccl_device_inline void motion_curve_keys_linear(ccl_global const KernelGlobals *
keys[1] = (1.0f - t) * keys[1] + t * next_keys[1];
}
-ccl_device_inline void motion_curve_keys_for_step(ccl_global const KernelGlobals *kg,
+ccl_device_inline void motion_curve_keys_for_step(KernelGlobals kg,
int offset,
int numkeys,
int numsteps,
@@ -119,7 +114,7 @@ ccl_device_inline void motion_curve_keys_for_step(ccl_global const KernelGlobals
}
/* return 2 curve key locations */
-ccl_device_inline void motion_curve_keys(ccl_global const KernelGlobals *kg,
+ccl_device_inline void motion_curve_keys(KernelGlobals kg,
int object,
int prim,
float time,
diff --git a/intern/cycles/kernel/geom/geom_motion_triangle.h b/intern/cycles/kernel/geom/geom_motion_triangle.h
index 547f03af47c..69d15f950ec 100644
--- a/intern/cycles/kernel/geom/geom_motion_triangle.h
+++ b/intern/cycles/kernel/geom/geom_motion_triangle.h
@@ -33,7 +33,7 @@ CCL_NAMESPACE_BEGIN
/* Time interpolation of vertex positions and normals */
-ccl_device_inline void motion_triangle_verts_for_step(ccl_global const KernelGlobals *kg,
+ccl_device_inline void motion_triangle_verts_for_step(KernelGlobals kg,
uint4 tri_vindex,
int offset,
int numverts,
@@ -60,7 +60,7 @@ ccl_device_inline void motion_triangle_verts_for_step(ccl_global const KernelGlo
}
}
-ccl_device_inline void motion_triangle_normals_for_step(ccl_global const KernelGlobals *kg,
+ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals kg,
uint4 tri_vindex,
int offset,
int numverts,
@@ -88,7 +88,7 @@ ccl_device_inline void motion_triangle_normals_for_step(ccl_global const KernelG
}
ccl_device_inline void motion_triangle_vertices(
- ccl_global const KernelGlobals *kg, int object, int prim, float time, float3 verts[3])
+ KernelGlobals kg, int object, int prim, float time, float3 verts[3])
{
/* get motion info */
int numsteps, numverts;
@@ -116,13 +116,8 @@ ccl_device_inline void motion_triangle_vertices(
verts[2] = (1.0f - t) * verts[2] + t * next_verts[2];
}
-ccl_device_inline float3 motion_triangle_smooth_normal(ccl_global const KernelGlobals *kg,
- float3 Ng,
- int object,
- int prim,
- float u,
- float v,
- float time)
+ccl_device_inline float3 motion_triangle_smooth_normal(
+ KernelGlobals kg, float3 Ng, int object, int prim, float u, float v, float time)
{
/* get motion info */
int numsteps, numverts;
diff --git a/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h b/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h
index 94d00875f0a..256e7add21e 100644
--- a/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h
+++ b/intern/cycles/kernel/geom/geom_motion_triangle_intersect.h
@@ -34,7 +34,7 @@ CCL_NAMESPACE_BEGIN
* a closer distance.
*/
-ccl_device_inline float3 motion_triangle_refine(ccl_global const KernelGlobals *kg,
+ccl_device_inline float3 motion_triangle_refine(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
@@ -92,7 +92,7 @@ ccl_device_noinline
ccl_device_inline
# endif
float3
- motion_triangle_refine_local(ccl_global const KernelGlobals *kg,
+ motion_triangle_refine_local(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
@@ -145,7 +145,7 @@ ccl_device_inline
* time and do a ray intersection with the resulting triangle.
*/
-ccl_device_inline bool motion_triangle_intersect(ccl_global const KernelGlobals *kg,
+ccl_device_inline bool motion_triangle_intersect(KernelGlobals kg,
ccl_private Intersection *isect,
float3 P,
float3 dir,
@@ -202,7 +202,7 @@ ccl_device_inline bool motion_triangle_intersect(ccl_global const KernelGlobals
* Returns whether traversal should be stopped.
*/
#ifdef __BVH_LOCAL__
-ccl_device_inline bool motion_triangle_intersect_local(ccl_global const KernelGlobals *kg,
+ccl_device_inline bool motion_triangle_intersect_local(KernelGlobals kg,
ccl_private LocalIntersection *local_isect,
float3 P,
float3 dir,
diff --git a/intern/cycles/kernel/geom/geom_motion_triangle_shader.h b/intern/cycles/kernel/geom/geom_motion_triangle_shader.h
index 25a68fa7781..fc7c181882e 100644
--- a/intern/cycles/kernel/geom/geom_motion_triangle_shader.h
+++ b/intern/cycles/kernel/geom/geom_motion_triangle_shader.h
@@ -34,7 +34,7 @@ CCL_NAMESPACE_BEGIN
* normals */
/* return 3 triangle vertex normals */
-ccl_device_noinline void motion_triangle_shader_setup(ccl_global const KernelGlobals *kg,
+ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals kg,
ccl_private ShaderData *sd,
const float3 P,
const float3 D,
diff --git a/intern/cycles/kernel/geom/geom_object.h b/intern/cycles/kernel/geom/geom_object.h
index 730c01d4709..34a9d639d9d 100644
--- a/intern/cycles/kernel/geom/geom_object.h
+++ b/intern/cycles/kernel/geom/geom_object.h
@@ -37,7 +37,7 @@ enum ObjectVectorTransform { OBJECT_PASS_MOTION_PRE = 0, OBJECT_PASS_MOTION_POST
/* Object to world space transformation */
-ccl_device_inline Transform object_fetch_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline Transform object_fetch_transform(KernelGlobals kg,
int object,
enum ObjectTransform type)
{
@@ -51,9 +51,7 @@ ccl_device_inline Transform object_fetch_transform(ccl_global const KernelGlobal
/* Lamp to world space transformation */
-ccl_device_inline Transform lamp_fetch_transform(ccl_global const KernelGlobals *kg,
- int lamp,
- bool inverse)
+ccl_device_inline Transform lamp_fetch_transform(KernelGlobals kg, int lamp, bool inverse)
{
if (inverse) {
return kernel_tex_fetch(__lights, lamp).itfm;
@@ -65,7 +63,7 @@ ccl_device_inline Transform lamp_fetch_transform(ccl_global const KernelGlobals
/* Object to world space transformation for motion vectors */
-ccl_device_inline Transform object_fetch_motion_pass_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline Transform object_fetch_motion_pass_transform(KernelGlobals kg,
int object,
enum ObjectVectorTransform type)
{
@@ -76,9 +74,7 @@ ccl_device_inline Transform object_fetch_motion_pass_transform(ccl_global const
/* Motion blurred object transformations */
#ifdef __OBJECT_MOTION__
-ccl_device_inline Transform object_fetch_transform_motion(ccl_global const KernelGlobals *kg,
- int object,
- float time)
+ccl_device_inline Transform object_fetch_transform_motion(KernelGlobals kg, int object, float time)
{
const uint motion_offset = kernel_tex_fetch(__objects, object).motion_offset;
ccl_global const DecomposedTransform *motion = &kernel_tex_fetch(__object_motion, motion_offset);
@@ -90,7 +86,7 @@ ccl_device_inline Transform object_fetch_transform_motion(ccl_global const Kerne
return tfm;
}
-ccl_device_inline Transform object_fetch_transform_motion_test(ccl_global const KernelGlobals *kg,
+ccl_device_inline Transform object_fetch_transform_motion_test(KernelGlobals kg,
int object,
float time,
ccl_private Transform *itfm)
@@ -117,7 +113,7 @@ ccl_device_inline Transform object_fetch_transform_motion_test(ccl_global const
/* Get transform matrix for shading point. */
-ccl_device_inline Transform object_get_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline Transform object_get_transform(KernelGlobals kg,
ccl_private const ShaderData *sd)
{
#ifdef __OBJECT_MOTION__
@@ -129,7 +125,7 @@ ccl_device_inline Transform object_get_transform(ccl_global const KernelGlobals
#endif
}
-ccl_device_inline Transform object_get_inverse_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline Transform object_get_inverse_transform(KernelGlobals kg,
ccl_private const ShaderData *sd)
{
#ifdef __OBJECT_MOTION__
@@ -142,7 +138,7 @@ ccl_device_inline Transform object_get_inverse_transform(ccl_global const Kernel
}
/* Transform position from object to world space */
-ccl_device_inline void object_position_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_position_transform(KernelGlobals kg,
ccl_private const ShaderData *sd,
ccl_private float3 *P)
{
@@ -159,7 +155,7 @@ ccl_device_inline void object_position_transform(ccl_global const KernelGlobals
/* Transform position from world to object space */
-ccl_device_inline void object_inverse_position_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_inverse_position_transform(KernelGlobals kg,
ccl_private const ShaderData *sd,
ccl_private float3 *P)
{
@@ -176,7 +172,7 @@ ccl_device_inline void object_inverse_position_transform(ccl_global const Kernel
/* Transform normal from world to object space */
-ccl_device_inline void object_inverse_normal_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_inverse_normal_transform(KernelGlobals kg,
ccl_private const ShaderData *sd,
ccl_private float3 *N)
{
@@ -201,7 +197,7 @@ ccl_device_inline void object_inverse_normal_transform(ccl_global const KernelGl
/* Transform normal from object to world space */
-ccl_device_inline void object_normal_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_normal_transform(KernelGlobals kg,
ccl_private const ShaderData *sd,
ccl_private float3 *N)
{
@@ -218,7 +214,7 @@ ccl_device_inline void object_normal_transform(ccl_global const KernelGlobals *k
/* Transform direction vector from object to world space */
-ccl_device_inline void object_dir_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_dir_transform(KernelGlobals kg,
ccl_private const ShaderData *sd,
ccl_private float3 *D)
{
@@ -235,7 +231,7 @@ ccl_device_inline void object_dir_transform(ccl_global const KernelGlobals *kg,
/* Transform direction vector from world to object space */
-ccl_device_inline void object_inverse_dir_transform(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_inverse_dir_transform(KernelGlobals kg,
ccl_private const ShaderData *sd,
ccl_private float3 *D)
{
@@ -252,8 +248,7 @@ ccl_device_inline void object_inverse_dir_transform(ccl_global const KernelGloba
/* Object center position */
-ccl_device_inline float3 object_location(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device_inline float3 object_location(KernelGlobals kg, ccl_private const ShaderData *sd)
{
if (sd->object == OBJECT_NONE)
return make_float3(0.0f, 0.0f, 0.0f);
@@ -270,7 +265,7 @@ ccl_device_inline float3 object_location(ccl_global const KernelGlobals *kg,
/* Color of the object */
-ccl_device_inline float3 object_color(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float3 object_color(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return make_float3(0.0f, 0.0f, 0.0f);
@@ -281,7 +276,7 @@ ccl_device_inline float3 object_color(ccl_global const KernelGlobals *kg, int ob
/* Pass ID number of object */
-ccl_device_inline float object_pass_id(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float object_pass_id(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return 0.0f;
@@ -291,7 +286,7 @@ ccl_device_inline float object_pass_id(ccl_global const KernelGlobals *kg, int o
/* Per lamp random number for shader variation */
-ccl_device_inline float lamp_random_number(ccl_global const KernelGlobals *kg, int lamp)
+ccl_device_inline float lamp_random_number(KernelGlobals kg, int lamp)
{
if (lamp == LAMP_NONE)
return 0.0f;
@@ -301,7 +296,7 @@ ccl_device_inline float lamp_random_number(ccl_global const KernelGlobals *kg, i
/* Per object random number for shader variation */
-ccl_device_inline float object_random_number(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float object_random_number(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return 0.0f;
@@ -311,7 +306,7 @@ ccl_device_inline float object_random_number(ccl_global const KernelGlobals *kg,
/* Particle ID from which this object was generated */
-ccl_device_inline int object_particle_id(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline int object_particle_id(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return 0;
@@ -321,7 +316,7 @@ ccl_device_inline int object_particle_id(ccl_global const KernelGlobals *kg, int
/* Generated texture coordinate on surface from where object was instanced */
-ccl_device_inline float3 object_dupli_generated(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float3 object_dupli_generated(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return make_float3(0.0f, 0.0f, 0.0f);
@@ -333,7 +328,7 @@ ccl_device_inline float3 object_dupli_generated(ccl_global const KernelGlobals *
/* UV texture coordinate on surface from where object was instanced */
-ccl_device_inline float3 object_dupli_uv(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float3 object_dupli_uv(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return make_float3(0.0f, 0.0f, 0.0f);
@@ -344,7 +339,7 @@ ccl_device_inline float3 object_dupli_uv(ccl_global const KernelGlobals *kg, int
/* Information about mesh for motion blurred triangles and curves */
-ccl_device_inline void object_motion_info(ccl_global const KernelGlobals *kg,
+ccl_device_inline void object_motion_info(KernelGlobals kg,
int object,
ccl_private int *numsteps,
ccl_private int *numverts,
@@ -362,7 +357,7 @@ ccl_device_inline void object_motion_info(ccl_global const KernelGlobals *kg,
/* Offset to an objects patch map */
-ccl_device_inline uint object_patch_map_offset(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline uint object_patch_map_offset(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return 0;
@@ -372,7 +367,7 @@ ccl_device_inline uint object_patch_map_offset(ccl_global const KernelGlobals *k
/* Volume step size */
-ccl_device_inline float object_volume_density(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float object_volume_density(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE) {
return 1.0f;
@@ -381,7 +376,7 @@ ccl_device_inline float object_volume_density(ccl_global const KernelGlobals *kg
return kernel_tex_fetch(__objects, object).volume_density;
}
-ccl_device_inline float object_volume_step_size(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float object_volume_step_size(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE) {
return kernel_data.background.volume_step_size;
@@ -392,14 +387,14 @@ ccl_device_inline float object_volume_step_size(ccl_global const KernelGlobals *
/* Pass ID for shader */
-ccl_device int shader_pass_id(ccl_global const KernelGlobals *kg, ccl_private const ShaderData *sd)
+ccl_device int shader_pass_id(KernelGlobals kg, ccl_private const ShaderData *sd)
{
return kernel_tex_fetch(__shaders, (sd->shader & SHADER_MASK)).pass_id;
}
/* Cryptomatte ID */
-ccl_device_inline float object_cryptomatte_id(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float object_cryptomatte_id(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return 0.0f;
@@ -407,7 +402,7 @@ ccl_device_inline float object_cryptomatte_id(ccl_global const KernelGlobals *kg
return kernel_tex_fetch(__objects, object).cryptomatte_object;
}
-ccl_device_inline float object_cryptomatte_asset_id(ccl_global const KernelGlobals *kg, int object)
+ccl_device_inline float object_cryptomatte_asset_id(KernelGlobals kg, int object)
{
if (object == OBJECT_NONE)
return 0;
@@ -417,42 +412,42 @@ ccl_device_inline float object_cryptomatte_asset_id(ccl_global const KernelGloba
/* Particle data from which object was instanced */
-ccl_device_inline uint particle_index(ccl_global const KernelGlobals *kg, int particle)
+ccl_device_inline uint particle_index(KernelGlobals kg, int particle)
{
return kernel_tex_fetch(__particles, particle).index;
}
-ccl_device float particle_age(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float particle_age(KernelGlobals kg, int particle)
{
return kernel_tex_fetch(__particles, particle).age;
}
-ccl_device float particle_lifetime(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float particle_lifetime(KernelGlobals kg, int particle)
{
return kernel_tex_fetch(__particles, particle).lifetime;
}
-ccl_device float particle_size(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float particle_size(KernelGlobals kg, int particle)
{
return kernel_tex_fetch(__particles, particle).size;
}
-ccl_device float4 particle_rotation(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float4 particle_rotation(KernelGlobals kg, int particle)
{
return kernel_tex_fetch(__particles, particle).rotation;
}
-ccl_device float3 particle_location(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float3 particle_location(KernelGlobals kg, int particle)
{
return float4_to_float3(kernel_tex_fetch(__particles, particle).location);
}
-ccl_device float3 particle_velocity(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float3 particle_velocity(KernelGlobals kg, int particle)
{
return float4_to_float3(kernel_tex_fetch(__particles, particle).velocity);
}
-ccl_device float3 particle_angular_velocity(ccl_global const KernelGlobals *kg, int particle)
+ccl_device float3 particle_angular_velocity(KernelGlobals kg, int particle)
{
return float4_to_float3(kernel_tex_fetch(__particles, particle).angular_velocity);
}
@@ -474,7 +469,7 @@ ccl_device_inline float3 bvh_inverse_direction(float3 dir)
/* Transform ray into object space to enter static object in BVH */
-ccl_device_inline float bvh_instance_push(ccl_global const KernelGlobals *kg,
+ccl_device_inline float bvh_instance_push(KernelGlobals kg,
int object,
ccl_private const Ray *ray,
ccl_private float3 *P,
@@ -494,7 +489,7 @@ ccl_device_inline float bvh_instance_push(ccl_global const KernelGlobals *kg,
/* Transform ray to exit static object in BVH. */
-ccl_device_inline float bvh_instance_pop(ccl_global const KernelGlobals *kg,
+ccl_device_inline float bvh_instance_pop(KernelGlobals kg,
int object,
ccl_private const Ray *ray,
ccl_private float3 *P,
@@ -516,7 +511,7 @@ ccl_device_inline float bvh_instance_pop(ccl_global const KernelGlobals *kg,
/* Same as above, but returns scale factor to apply to multiple intersection distances */
-ccl_device_inline void bvh_instance_pop_factor(ccl_global const KernelGlobals *kg,
+ccl_device_inline void bvh_instance_pop_factor(KernelGlobals kg,
int object,
ccl_private const Ray *ray,
ccl_private float3 *P,
@@ -535,7 +530,7 @@ ccl_device_inline void bvh_instance_pop_factor(ccl_global const KernelGlobals *k
#ifdef __OBJECT_MOTION__
/* Transform ray into object space to enter motion blurred object in BVH */
-ccl_device_inline float bvh_instance_motion_push(ccl_global const KernelGlobals *kg,
+ccl_device_inline float bvh_instance_motion_push(KernelGlobals kg,
int object,
ccl_private const Ray *ray,
ccl_private float3 *P,
@@ -556,7 +551,7 @@ ccl_device_inline float bvh_instance_motion_push(ccl_global const KernelGlobals
/* Transform ray to exit motion blurred object in BVH. */
-ccl_device_inline float bvh_instance_motion_pop(ccl_global const KernelGlobals *kg,
+ccl_device_inline float bvh_instance_motion_pop(KernelGlobals kg,
int object,
ccl_private const Ray *ray,
ccl_private float3 *P,
@@ -578,7 +573,7 @@ ccl_device_inline float bvh_instance_motion_pop(ccl_global const KernelGlobals *
/* Same as above, but returns scale factor to apply to multiple intersection distances */
-ccl_device_inline void bvh_instance_motion_pop_factor(ccl_global const KernelGlobals *kg,
+ccl_device_inline void bvh_instance_motion_pop_factor(KernelGlobals kg,
int object,
ccl_private const Ray *ray,
ccl_private float3 *P,
diff --git a/intern/cycles/kernel/geom/geom_patch.h b/intern/cycles/kernel/geom/geom_patch.h
index b54eafd6220..bd797ef52ab 100644
--- a/intern/cycles/kernel/geom/geom_patch.h
+++ b/intern/cycles/kernel/geom/geom_patch.h
@@ -64,7 +64,7 @@ ccl_device_inline int patch_map_resolve_quadrant(float median,
/* retrieve PatchHandle from patch coords */
ccl_device_inline PatchHandle
-patch_map_find_patch(ccl_global const KernelGlobals *kg, int object, int patch, float u, float v)
+patch_map_find_patch(KernelGlobals kg, int object, int patch, float u, float v)
{
PatchHandle handle;
@@ -201,7 +201,7 @@ ccl_device_inline void patch_eval_normalize_coords(uint patch_bits,
/* retrieve patch control indices */
-ccl_device_inline int patch_eval_indices(ccl_global const KernelGlobals *kg,
+ccl_device_inline int patch_eval_indices(KernelGlobals kg,
ccl_private const PatchHandle *handle,
int channel,
int indices[PATCH_MAX_CONTROL_VERTS])
@@ -218,7 +218,7 @@ ccl_device_inline int patch_eval_indices(ccl_global const KernelGlobals *kg,
/* evaluate patch basis functions */
-ccl_device_inline void patch_eval_basis(ccl_global const KernelGlobals *kg,
+ccl_device_inline void patch_eval_basis(KernelGlobals kg,
ccl_private const PatchHandle *handle,
float u,
float v,
@@ -257,7 +257,7 @@ ccl_device_inline void patch_eval_basis(ccl_global const KernelGlobals *kg,
/* generic function for evaluating indices and weights from patch coords */
-ccl_device_inline int patch_eval_control_verts(ccl_global const KernelGlobals *kg,
+ccl_device_inline int patch_eval_control_verts(KernelGlobals kg,
int object,
int patch,
float u,
@@ -279,7 +279,7 @@ ccl_device_inline int patch_eval_control_verts(ccl_global const KernelGlobals *k
/* functions for evaluating attributes on patches */
-ccl_device float patch_eval_float(ccl_global const KernelGlobals *kg,
+ccl_device float patch_eval_float(KernelGlobals kg,
ccl_private const ShaderData *sd,
int offset,
int patch,
@@ -316,7 +316,7 @@ ccl_device float patch_eval_float(ccl_global const KernelGlobals *kg,
return val;
}
-ccl_device float2 patch_eval_float2(ccl_global const KernelGlobals *kg,
+ccl_device float2 patch_eval_float2(KernelGlobals kg,
ccl_private const ShaderData *sd,
int offset,
int patch,
@@ -353,7 +353,7 @@ ccl_device float2 patch_eval_float2(ccl_global const KernelGlobals *kg,
return val;
}
-ccl_device float3 patch_eval_float3(ccl_global const KernelGlobals *kg,
+ccl_device float3 patch_eval_float3(KernelGlobals kg,
ccl_private const ShaderData *sd,
int offset,
int patch,
@@ -390,7 +390,7 @@ ccl_device float3 patch_eval_float3(ccl_global const KernelGlobals *kg,
return val;
}
-ccl_device float4 patch_eval_float4(ccl_global const KernelGlobals *kg,
+ccl_device float4 patch_eval_float4(KernelGlobals kg,
ccl_private const ShaderData *sd,
int offset,
int patch,
@@ -427,7 +427,7 @@ ccl_device float4 patch_eval_float4(ccl_global const KernelGlobals *kg,
return val;
}
-ccl_device float4 patch_eval_uchar4(ccl_global const KernelGlobals *kg,
+ccl_device float4 patch_eval_uchar4(KernelGlobals kg,
ccl_private const ShaderData *sd,
int offset,
int patch,
diff --git a/intern/cycles/kernel/geom/geom_primitive.h b/intern/cycles/kernel/geom/geom_primitive.h
index 869b911f76f..91b29c7f990 100644
--- a/intern/cycles/kernel/geom/geom_primitive.h
+++ b/intern/cycles/kernel/geom/geom_primitive.h
@@ -31,7 +31,7 @@ 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(ccl_global const KernelGlobals *kg,
+ccl_device_inline float primitive_surface_attribute_float(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float *dx,
@@ -57,7 +57,7 @@ ccl_device_inline float primitive_surface_attribute_float(ccl_global const Kerne
}
}
-ccl_device_inline float2 primitive_surface_attribute_float2(ccl_global const KernelGlobals *kg,
+ccl_device_inline float2 primitive_surface_attribute_float2(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float2 *dx,
@@ -83,7 +83,7 @@ ccl_device_inline float2 primitive_surface_attribute_float2(ccl_global const Ker
}
}
-ccl_device_inline float3 primitive_surface_attribute_float3(ccl_global const KernelGlobals *kg,
+ccl_device_inline float3 primitive_surface_attribute_float3(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float3 *dx,
@@ -109,12 +109,11 @@ ccl_device_inline float3 primitive_surface_attribute_float3(ccl_global const Ker
}
}
-ccl_device_forceinline float4
-primitive_surface_attribute_float4(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd,
- const AttributeDescriptor desc,
- ccl_private float4 *dx,
- ccl_private float4 *dy)
+ccl_device_forceinline float4 primitive_surface_attribute_float4(KernelGlobals kg,
+ ccl_private const ShaderData *sd,
+ const AttributeDescriptor desc,
+ ccl_private float4 *dx,
+ ccl_private float4 *dy)
{
if (sd->type & PRIMITIVE_ALL_TRIANGLE) {
if (subd_triangle_patch(kg, sd) == ~0)
@@ -149,7 +148,7 @@ ccl_device_inline bool primitive_is_volume_attribute(ccl_private const ShaderDat
return sd->type == PRIMITIVE_VOLUME;
}
-ccl_device_inline float primitive_volume_attribute_float(ccl_global const KernelGlobals *kg,
+ccl_device_inline float primitive_volume_attribute_float(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc)
{
@@ -161,7 +160,7 @@ ccl_device_inline float primitive_volume_attribute_float(ccl_global const Kernel
}
}
-ccl_device_inline float3 primitive_volume_attribute_float3(ccl_global const KernelGlobals *kg,
+ccl_device_inline float3 primitive_volume_attribute_float3(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc)
{
@@ -173,7 +172,7 @@ ccl_device_inline float3 primitive_volume_attribute_float3(ccl_global const Kern
}
}
-ccl_device_inline float4 primitive_volume_attribute_float4(ccl_global const KernelGlobals *kg,
+ccl_device_inline float4 primitive_volume_attribute_float4(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc)
{
@@ -188,8 +187,7 @@ ccl_device_inline float4 primitive_volume_attribute_float4(ccl_global const Kern
/* Default UV coordinate */
-ccl_device_inline float3 primitive_uv(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device_inline float3 primitive_uv(KernelGlobals kg, ccl_private const ShaderData *sd)
{
const AttributeDescriptor desc = find_attribute(kg, sd, ATTR_STD_UV);
@@ -202,7 +200,7 @@ ccl_device_inline float3 primitive_uv(ccl_global const KernelGlobals *kg,
/* Ptex coordinates */
-ccl_device bool primitive_ptex(ccl_global const KernelGlobals *kg,
+ccl_device bool primitive_ptex(KernelGlobals kg,
ccl_private ShaderData *sd,
ccl_private float2 *uv,
ccl_private int *face_id)
@@ -225,7 +223,7 @@ ccl_device bool primitive_ptex(ccl_global const KernelGlobals *kg,
/* Surface tangent */
-ccl_device float3 primitive_tangent(ccl_global const KernelGlobals *kg, ccl_private ShaderData *sd)
+ccl_device float3 primitive_tangent(KernelGlobals kg, ccl_private ShaderData *sd)
{
#ifdef __HAIR__
if (sd->type & PRIMITIVE_ALL_CURVE)
@@ -257,7 +255,7 @@ ccl_device float3 primitive_tangent(ccl_global const KernelGlobals *kg, ccl_priv
/* Motion vector for motion pass */
-ccl_device_inline float4 primitive_motion_vector(ccl_global const KernelGlobals *kg,
+ccl_device_inline float4 primitive_motion_vector(KernelGlobals kg,
ccl_private const ShaderData *sd)
{
/* center position */
diff --git a/intern/cycles/kernel/geom/geom_shader_data.h b/intern/cycles/kernel/geom/geom_shader_data.h
index 2cf60e263c3..e6a5b8f7923 100644
--- a/intern/cycles/kernel/geom/geom_shader_data.h
+++ b/intern/cycles/kernel/geom/geom_shader_data.h
@@ -25,7 +25,7 @@ CCL_NAMESPACE_BEGIN
/* ShaderData setup from incoming ray */
#ifdef __OBJECT_MOTION__
-ccl_device void shader_setup_object_transforms(ccl_global const KernelGlobals *ccl_restrict kg,
+ccl_device void shader_setup_object_transforms(KernelGlobals kg,
ccl_private ShaderData *ccl_restrict sd,
float time)
{
@@ -38,7 +38,7 @@ ccl_device void shader_setup_object_transforms(ccl_global const KernelGlobals *c
/* TODO: break this up if it helps reduce register pressure to load data from
* global memory as we write it to shader-data. */
-ccl_device_inline void shader_setup_from_ray(ccl_global const KernelGlobals *ccl_restrict kg,
+ccl_device_inline void shader_setup_from_ray(KernelGlobals kg,
ccl_private ShaderData *ccl_restrict sd,
ccl_private const Ray *ccl_restrict ray,
ccl_private const Intersection *ccl_restrict isect)
@@ -135,7 +135,7 @@ ccl_device_inline void shader_setup_from_ray(ccl_global const KernelGlobals *ccl
/* ShaderData setup from position sampled on mesh */
-ccl_device_inline void shader_setup_from_sample(ccl_global const KernelGlobals *ccl_restrict kg,
+ccl_device_inline void shader_setup_from_sample(KernelGlobals kg,
ccl_private ShaderData *ccl_restrict sd,
const float3 P,
const float3 Ng,
@@ -247,7 +247,7 @@ ccl_device_inline void shader_setup_from_sample(ccl_global const KernelGlobals *
/* ShaderData setup for displacement */
-ccl_device void shader_setup_from_displace(ccl_global const KernelGlobals *ccl_restrict kg,
+ccl_device void shader_setup_from_displace(KernelGlobals kg,
ccl_private ShaderData *ccl_restrict sd,
int object,
int prim,
@@ -281,8 +281,7 @@ ccl_device void shader_setup_from_displace(ccl_global const KernelGlobals *ccl_r
/* ShaderData setup from ray into background */
-ccl_device_inline void shader_setup_from_background(ccl_global const KernelGlobals *ccl_restrict
- kg,
+ccl_device_inline void shader_setup_from_background(KernelGlobals kg,
ccl_private ShaderData *ccl_restrict sd,
const float3 ray_P,
const float3 ray_D,
@@ -326,7 +325,7 @@ ccl_device_inline void shader_setup_from_background(ccl_global const KernelGloba
/* ShaderData setup from point inside volume */
#ifdef __VOLUME__
-ccl_device_inline void shader_setup_from_volume(ccl_global const KernelGlobals *ccl_restrict kg,
+ccl_device_inline void shader_setup_from_volume(KernelGlobals kg,
ccl_private ShaderData *ccl_restrict sd,
ccl_private const Ray *ccl_restrict ray)
{
diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h b/intern/cycles/kernel/geom/geom_subd_triangle.h
index 927d630fe91..8a9a3f71231 100644
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h
@@ -22,15 +22,14 @@ CCL_NAMESPACE_BEGIN
/* Patch index for triangle, -1 if not subdivision triangle */
-ccl_device_inline uint subd_triangle_patch(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd)
+ccl_device_inline uint subd_triangle_patch(KernelGlobals kg, ccl_private const ShaderData *sd)
{
return (sd->prim != PRIM_NONE) ? kernel_tex_fetch(__tri_patch, sd->prim) : ~0;
}
/* UV coords of triangle within patch */
-ccl_device_inline void subd_triangle_patch_uv(ccl_global const KernelGlobals *kg,
+ccl_device_inline void subd_triangle_patch_uv(KernelGlobals kg,
ccl_private const ShaderData *sd,
float2 uv[3])
{
@@ -43,7 +42,7 @@ ccl_device_inline void subd_triangle_patch_uv(ccl_global const KernelGlobals *kg
/* Vertex indices of patch */
-ccl_device_inline uint4 subd_triangle_patch_indices(ccl_global const KernelGlobals *kg, int patch)
+ccl_device_inline uint4 subd_triangle_patch_indices(KernelGlobals kg, int patch)
{
uint4 indices;
@@ -57,24 +56,21 @@ ccl_device_inline uint4 subd_triangle_patch_indices(ccl_global const KernelGloba
/* Originating face for patch */
-ccl_device_inline uint subd_triangle_patch_face(ccl_global const KernelGlobals *kg, int patch)
+ccl_device_inline uint subd_triangle_patch_face(KernelGlobals kg, int patch)
{
return kernel_tex_fetch(__patches, patch + 4);
}
/* Number of corners on originating face */
-ccl_device_inline uint subd_triangle_patch_num_corners(ccl_global const KernelGlobals *kg,
- int patch)
+ccl_device_inline uint subd_triangle_patch_num_corners(KernelGlobals kg, int patch)
{
return kernel_tex_fetch(__patches, patch + 5) & 0xffff;
}
/* Indices of the four corners that are used by the patch */
-ccl_device_inline void subd_triangle_patch_corners(ccl_global const KernelGlobals *kg,
- int patch,
- int corners[4])
+ccl_device_inline void subd_triangle_patch_corners(KernelGlobals kg, int patch, int corners[4])
{
uint4 data;
@@ -105,7 +101,7 @@ ccl_device_inline void subd_triangle_patch_corners(ccl_global const KernelGlobal
/* Reading attributes on various subdivision triangle elements */
-ccl_device_noinline float subd_triangle_attribute_float(ccl_global const KernelGlobals *kg,
+ccl_device_noinline float subd_triangle_attribute_float(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float *dx,
@@ -244,7 +240,7 @@ ccl_device_noinline float subd_triangle_attribute_float(ccl_global const KernelG
}
}
-ccl_device_noinline float2 subd_triangle_attribute_float2(ccl_global const KernelGlobals *kg,
+ccl_device_noinline float2 subd_triangle_attribute_float2(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float2 *dx,
@@ -387,7 +383,7 @@ ccl_device_noinline float2 subd_triangle_attribute_float2(ccl_global const Kerne
}
}
-ccl_device_noinline float3 subd_triangle_attribute_float3(ccl_global const KernelGlobals *kg,
+ccl_device_noinline float3 subd_triangle_attribute_float3(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float3 *dx,
@@ -529,7 +525,7 @@ ccl_device_noinline float3 subd_triangle_attribute_float3(ccl_global const Kerne
}
}
-ccl_device_noinline float4 subd_triangle_attribute_float4(ccl_global const KernelGlobals *kg,
+ccl_device_noinline float4 subd_triangle_attribute_float4(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float4 *dx,
diff --git a/intern/cycles/kernel/geom/geom_triangle.h b/intern/cycles/kernel/geom/geom_triangle.h
index 17f87b7c570..233e901c7ca 100644
--- a/intern/cycles/kernel/geom/geom_triangle.h
+++ b/intern/cycles/kernel/geom/geom_triangle.h
@@ -25,8 +25,7 @@
CCL_NAMESPACE_BEGIN
/* Normal on triangle. */
-ccl_device_inline float3 triangle_normal(ccl_global const KernelGlobals *kg,
- ccl_private ShaderData *sd)
+ccl_device_inline float3 triangle_normal(KernelGlobals kg, ccl_private ShaderData *sd)
{
/* load triangle vertices */
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim);
@@ -44,7 +43,7 @@ ccl_device_inline float3 triangle_normal(ccl_global const KernelGlobals *kg,
}
/* Point and normal on triangle. */
-ccl_device_inline void triangle_point_normal(ccl_global const KernelGlobals *kg,
+ccl_device_inline void triangle_point_normal(KernelGlobals kg,
int object,
int prim,
float u,
@@ -76,7 +75,7 @@ ccl_device_inline void triangle_point_normal(ccl_global const KernelGlobals *kg,
/* Triangle vertex locations */
-ccl_device_inline void triangle_vertices(ccl_global const KernelGlobals *kg, int prim, float3 P[3])
+ccl_device_inline void triangle_vertices(KernelGlobals kg, int prim, float3 P[3])
{
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim);
P[0] = float4_to_float3(kernel_tex_fetch(__tri_verts, tri_vindex.w + 0));
@@ -86,7 +85,7 @@ ccl_device_inline void triangle_vertices(ccl_global const KernelGlobals *kg, int
/* Triangle vertex locations and vertex normals */
-ccl_device_inline void triangle_vertices_and_normals(ccl_global const KernelGlobals *kg,
+ccl_device_inline void triangle_vertices_and_normals(KernelGlobals kg,
int prim,
float3 P[3],
float3 N[3])
@@ -103,7 +102,7 @@ ccl_device_inline void triangle_vertices_and_normals(ccl_global const KernelGlob
/* Interpolate smooth vertex normal from vertices */
ccl_device_inline float3
-triangle_smooth_normal(ccl_global const KernelGlobals *kg, float3 Ng, int prim, float u, float v)
+triangle_smooth_normal(KernelGlobals kg, float3 Ng, int prim, float u, float v)
{
/* load triangle vertices */
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim);
@@ -116,12 +115,8 @@ triangle_smooth_normal(ccl_global const KernelGlobals *kg, float3 Ng, int prim,
return is_zero(N) ? Ng : N;
}
-ccl_device_inline float3 triangle_smooth_normal_unnormalized(ccl_global const KernelGlobals *kg,
- ccl_private const ShaderData *sd,
- float3 Ng,
- int prim,
- float u,
- float v)
+ccl_device_inline float3 triangle_smooth_normal_unnormalized(
+ KernelGlobals kg, ccl_private const ShaderData *sd, float3 Ng, int prim, float u, float v)
{
/* load triangle vertices */
const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, prim);
@@ -143,7 +138,7 @@ ccl_device_inline float3 triangle_smooth_normal_unnormalized(ccl_global const Ke
/* Ray differentials on triangle */
-ccl_device_inline void triangle_dPdudv(ccl_global const KernelGlobals *kg,
+ccl_device_inline void triangle_dPdudv(KernelGlobals kg,
int prim,
ccl_private float3 *dPdu,
ccl_private float3 *dPdv)
@@ -161,7 +156,7 @@ ccl_device_inline void triangle_dPdudv(ccl_global const KernelGlobals *kg,
/* Reading attributes on various triangle elements */
-ccl_device float triangle_attribute_float(ccl_global const KernelGlobals *kg,
+ccl_device float triangle_attribute_float(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float *dx,
@@ -211,7 +206,7 @@ ccl_device float triangle_attribute_float(ccl_global const KernelGlobals *kg,
}
}
-ccl_device float2 triangle_attribute_float2(ccl_global const KernelGlobals *kg,
+ccl_device float2 triangle_attribute_float2(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float2 *dx,
@@ -261,7 +256,7 @@ ccl_device float2 triangle_attribute_float2(ccl_global const KernelGlobals *kg,
}
}
-ccl_device float3 triangle_attribute_float3(ccl_global const KernelGlobals *kg,
+ccl_device float3 triangle_attribute_float3(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float3 *dx,
@@ -311,7 +306,7 @@ ccl_device float3 triangle_attribute_float3(ccl_global const KernelGlobals *kg,
}
}
-ccl_device float4 triangle_attribute_float4(ccl_global const KernelGlobals *kg,
+ccl_device float4 triangle_attribute_float4(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc,
ccl_private float4 *dx,
diff --git a/intern/cycles/kernel/geom/geom_triangle_intersect.h b/intern/cycles/kernel/geom/geom_triangle_intersect.h
index f637206da19..fee629cc75a 100644
--- a/intern/cycles/kernel/geom/geom_triangle_intersect.h
+++ b/intern/cycles/kernel/geom/geom_triangle_intersect.h
@@ -26,7 +26,7 @@
CCL_NAMESPACE_BEGIN
-ccl_device_inline bool triangle_intersect(ccl_global const KernelGlobals *kg,
+ccl_device_inline bool triangle_intersect(KernelGlobals kg,
ccl_private Intersection *isect,
float3 P,
float3 dir,
@@ -85,7 +85,7 @@ ccl_device_inline bool triangle_intersect(ccl_global const KernelGlobals *kg,
*/
#ifdef __BVH_LOCAL__
-ccl_device_inline bool triangle_intersect_local(ccl_global const KernelGlobals *kg,
+ccl_device_inline bool triangle_intersect_local(KernelGlobals kg,
ccl_private LocalIntersection *local_isect,
float3 P,
float3 dir,
@@ -200,7 +200,7 @@ ccl_device_inline bool triangle_intersect_local(ccl_global const KernelGlobals *
* http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Acceleration/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf
*/
-ccl_device_inline float3 triangle_refine(ccl_global const KernelGlobals *kg,
+ccl_device_inline float3 triangle_refine(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
@@ -256,7 +256,7 @@ ccl_device_inline float3 triangle_refine(ccl_global const KernelGlobals *kg,
/* Same as above, except that t is assumed to be in object space for
* instancing.
*/
-ccl_device_inline float3 triangle_refine_local(ccl_global const KernelGlobals *kg,
+ccl_device_inline float3 triangle_refine_local(KernelGlobals kg,
ccl_private ShaderData *sd,
float3 P,
float3 D,
diff --git a/intern/cycles/kernel/geom/geom_volume.h b/intern/cycles/kernel/geom/geom_volume.h
index c466c3fb07a..4e83ad6acb3 100644
--- a/intern/cycles/kernel/geom/geom_volume.h
+++ b/intern/cycles/kernel/geom/geom_volume.h
@@ -31,7 +31,7 @@ CCL_NAMESPACE_BEGIN
/* Return position normalized to 0..1 in mesh bounds */
-ccl_device_inline float3 volume_normalized_position(ccl_global const KernelGlobals *kg,
+ccl_device_inline float3 volume_normalized_position(KernelGlobals kg,
ccl_private const ShaderData *sd,
float3 P)
{
@@ -70,7 +70,7 @@ ccl_device float3 volume_attribute_value_to_float3(const float4 value)
}
}
-ccl_device float4 volume_attribute_float4(ccl_global const KernelGlobals *kg,
+ccl_device float4 volume_attribute_float4(KernelGlobals kg,
ccl_private const ShaderData *sd,
const AttributeDescriptor desc)
{