Commit: d66ffaebef924dcfa1e5396852166760c07f0342
Author: Mai Lavelle
Date:   Tue Mar 28 02:28:36 2017 -0400
Branches: master
https://developer.blender.org/rBd66ffaebef924dcfa1e5396852166760c07f0342

Cycles: Check ray state properly to avoid endless loop

The state mask wasnt applied before comparison giving false results. It
shouldnt really happen that a ray state contains any flags that need to
be masked away, but if it does happen its better to not get stuck.

===================================================================

M       intern/cycles/device/device_split_kernel.cpp

===================================================================

diff --git a/intern/cycles/device/device_split_kernel.cpp 
b/intern/cycles/device/device_split_kernel.cpp
index ae462a560b7..30e7a58281c 100644
--- a/intern/cycles/device/device_split_kernel.cpp
+++ b/intern/cycles/device/device_split_kernel.cpp
@@ -256,10 +256,8 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task,
                        activeRaysAvailable = false;
 
                        for(int rayStateIter = 0; rayStateIter < global_size[0] 
* global_size[1]; ++rayStateIter) {
-                               int8_t state = 
ray_state.get_data()[rayStateIter];
-
-                               if(state != RAY_INACTIVE) {
-                                       if(state == RAY_INVALID) {
+                               if(!IS_STATE(ray_state.get_data(), 
rayStateIter, RAY_INACTIVE)) {
+                                       if(IS_STATE(ray_state.get_data(), 
rayStateIter, RAY_INVALID)) {
                                                /* Something went wrong, abort 
to avoid looping endlessly. */
                                                device->set_error("Split kernel 
error: invalid ray state");
                                                return false;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to