[Bf-blender-cvs] [d66ffaebef9] master: Cycles: Check ray state properly to avoid endless loop
Mai Lavelle
noreply at git.blender.org
Fri Apr 7 12:06:23 CEST 2017
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;
More information about the Bf-blender-cvs
mailing list