forked from bartvdbraak/blender
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.
This commit is contained in:
parent
e8e341b585
commit
d66ffaebef
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user