Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMai Lavelle <mai.lavelle@gmail.com>2017-03-28 09:28:36 +0300
committerMai Lavelle <mai.lavelle@gmail.com>2017-04-07 13:06:08 +0300
commitd66ffaebef924dcfa1e5396852166760c07f0342 (patch)
tree92de1e8ade7e031ffd2402f738ec98adc045c188 /intern/cycles/device
parente8e341b585430dfca96b85ed540b398bc0af93a1 (diff)
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.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r--intern/cycles/device/device_split_kernel.cpp6
1 files changed, 2 insertions, 4 deletions
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;