forked from blender/blender
realize-depth #5
@ -7,6 +7,8 @@
|
||||
#include "COM_ConstantOperation.h"
|
||||
#include "COM_MultiThreadedOperation.h"
|
||||
|
||||
#include <mutex>
|
||||
|
||||
namespace blender::compositor {
|
||||
|
||||
class TranslateOperation : public MultiThreadedOperation {
|
||||
@ -24,6 +26,8 @@ class TranslateOperation : public MultiThreadedOperation {
|
||||
bool is_delta_set_;
|
||||
bool is_relative_;
|
||||
|
||||
std::mutex mutex_;
|
||||
|
||||
protected:
|
||||
MemoryBufferExtend x_extend_mode_;
|
||||
MemoryBufferExtend y_extend_mode_;
|
||||
@ -60,6 +64,11 @@ class TranslateOperation : public MultiThreadedOperation {
|
||||
inline void ensure_delta()
|
||||
{
|
||||
if (!is_delta_set_) {
|
||||
std::unique_lock lock(mutex_);
|
||||
if (is_delta_set_) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (execution_model_ == eExecutionModel::Tiled) {
|
||||
float temp_delta[4];
|
||||
input_xoperation_->read_sampled(temp_delta, 0, 0, PixelSampler::Nearest);
|
||||
|
Loading…
Reference in New Issue
Block a user