Fix T53962: Cycles OpenCL compile error in some scenes.

This part of 212a8d9e needed to be ported over for 2ca933f to work.
This commit is contained in:
Brecht Van Lommel 2018-01-31 14:42:30 +01:00
parent 1052497aad
commit 3e2909cf9d
Notes: blender-bot 2023-02-14 06:13:33 +01:00
Referenced by issue #53962, Blender 2.79a rc gpu vega 56 rendering failed
3 changed files with 10 additions and 0 deletions

View File

@ -57,6 +57,7 @@ ccl_device_noinline void shader_setup_from_ray(KernelGlobals *kg,
#ifdef __INSTANCING__
sd->object = (isect->object == PRIM_NONE)? kernel_tex_fetch(__prim_object, isect->prim): isect->object;
#endif
sd->lamp = LAMP_NONE;
sd->type = isect->type;
sd->flag = 0;
@ -265,6 +266,7 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg,
#ifdef __INSTANCING__
sd->object = object;
#endif
sd->lamp = LAMP_NONE;
/* currently no access to bvh prim index for strand sd->prim*/
sd->prim = prim;
#ifdef __UV__
@ -286,6 +288,7 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg,
else if(lamp != LAMP_NONE) {
sd->ob_tfm = lamp_fetch_transform(kg, lamp, false);
sd->ob_itfm = lamp_fetch_transform(kg, lamp, true);
sd->lamp = lamp;
#endif
}
@ -393,6 +396,7 @@ ccl_device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderDat
#ifdef __INSTANCING__
sd->object = PRIM_NONE;
#endif
sd->lamp = LAMP_NONE;
sd->prim = PRIM_NONE;
#ifdef __UV__
sd->u = 0.0f;
@ -435,6 +439,7 @@ ccl_device_inline void shader_setup_from_volume(KernelGlobals *kg, ShaderData *s
#ifdef __INSTANCING__
sd->object = PRIM_NONE; /* todo: fill this for texture coordinates */
#endif
sd->lamp = LAMP_NONE;
sd->prim = PRIM_NONE;
sd->type = PRIMITIVE_NONE;

View File

@ -25,6 +25,9 @@ typedef struct VolumeState {
} VolumeState;
/* Get PathState ready for use for volume stack evaluation. */
# ifdef __SPLIT_KERNEL__
ccl_addr_space
# endif
ccl_device_inline PathState *shadow_blocked_volume_path_state(
KernelGlobals *kg,
VolumeState *volume_state,

View File

@ -935,6 +935,8 @@ typedef ccl_addr_space struct ShaderData {
float v;
/* object id if there is one, ~0 otherwise */
int object;
/* lamp id if there is one, ~0 otherwise */
int lamp;
/* motion blur sample time */
float time;