[Bf-blender-cvs] [41a4967] master: Fix T49003: Cycles volumes have wrong results after recent microdisp commits
Mai Lavelle
noreply at git.blender.org
Tue Aug 2 21:33:30 CEST 2016
Commit: 41a4967b301f2faaee5ab519f5373c3b6cab33c0
Author: Mai Lavelle
Date: Tue Aug 2 15:27:41 2016 -0400
Branches: master
https://developer.blender.org/rB41a4967b301f2faaee5ab519f5373c3b6cab33c0
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
===================================================================
M intern/cycles/kernel/geom/geom_subd_triangle.h
===================================================================
diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h b/intern/cycles/kernel/geom/geom_subd_triangle.h
index e4597ab..bf9be18 100644
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h
@@ -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 */
More information about the Bf-blender-cvs
mailing list