Fix T49003: Cycles volumes have wrong results after recent microdisp commits

Problem was that sd->prim can be -1 for volumes and was causing check in subd
code to access out of bounds
This commit is contained in:
Mai Lavelle 2016-08-02 15:27:41 -04:00
parent f593333099
commit 41a4967b30
Notes: blender-bot 2023-11-20 12:14:32 +01:00
Referenced by issue blender/blender-addons#49003, Cloud add-on wrong render and 3D View Rendered display
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ CCL_NAMESPACE_BEGIN
ccl_device_inline uint subd_triangle_patch(KernelGlobals *kg, const ShaderData *sd)
{
return kernel_tex_fetch(__tri_patch, ccl_fetch(sd, prim));
return (ccl_fetch(sd, prim) != PRIM_NONE) ? kernel_tex_fetch(__tri_patch, ccl_fetch(sd, prim)) : ~0;
}
/* UV coords of triangle within patch */