Skip to content

Commit e66d206

Browse files
committed
Merge pull request #324 from floe/opencl-fix
fix opencl rebuild after config change
2 parents 77e901a + 5ee5de0 commit e66d206

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/protonect/src/opencl_depth_packet_processor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ void OpenCLDepthPacketProcessor::setConfiguration(const libfreenect2::DepthPacke
611611
// OpenCL program needs to be rebuilt, then reinitialized
612612
impl_->programBuilt = false;
613613
impl_->programInitialized = false;
614-
impl_->buildProgram(impl_->sourceCode);
615614
}
616615
else if (impl_->config.EnableBilateralFilter != config.EnableBilateralFilter
617616
|| impl_->config.EnableEdgeAwareFilter != config.EnableEdgeAwareFilter)
@@ -621,6 +620,8 @@ void OpenCLDepthPacketProcessor::setConfiguration(const libfreenect2::DepthPacke
621620
}
622621

623622
impl_->config = config;
623+
if (!impl_->programBuilt)
624+
impl_->buildProgram(impl_->sourceCode);
624625
}
625626

626627
void OpenCLDepthPacketProcessor::loadP0TablesFromCommandResponse(unsigned char *buffer, size_t buffer_length)

0 commit comments

Comments
 (0)