From 41a4967b301f2faaee5ab519f5373c3b6cab33c0 Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Tue, 2 Aug 2016 15:27:41 -0400 Subject: 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 --- intern/cycles/kernel/geom/geom_subd_triangle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/cycles/kernel/geom/geom_subd_triangle.h b/intern/cycles/kernel/geom/geom_subd_triangle.h index e4597aba56e..bf9be182345 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 */ -- cgit v1.2.3