Get OCIO node groundwork working
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <QMatrix4x4>
|
||||
|
||||
#include "generatejob.h"
|
||||
#include "render/colorprocessor.h"
|
||||
#include "render/texture.h"
|
||||
|
||||
namespace olive {
|
||||
@@ -34,6 +35,7 @@ public:
|
||||
{
|
||||
iterations_ = 1;
|
||||
iterative_input_ = nullptr;
|
||||
use_ocio_ = false;
|
||||
}
|
||||
|
||||
const QString& GetShaderID() const
|
||||
@@ -87,6 +89,38 @@ public:
|
||||
interpolation_.insert(id, interp);
|
||||
}
|
||||
|
||||
bool UseOCIO() const
|
||||
{
|
||||
return use_ocio_;
|
||||
}
|
||||
|
||||
void SetUseOCIO(bool use_ocio)
|
||||
{
|
||||
use_ocio_ = use_ocio;
|
||||
}
|
||||
|
||||
ColorProcessorPtr ColorProcessor()
|
||||
{
|
||||
return color_processor_;
|
||||
}
|
||||
|
||||
void SetColorProcessor(ColorProcessorPtr processor)
|
||||
{
|
||||
color_processor_ = processor;
|
||||
}
|
||||
|
||||
OCIO::GpuShaderDescRcPtr ShaderDesc()
|
||||
{
|
||||
return shader_desc_;
|
||||
}
|
||||
|
||||
void SetShaderDesc(OCIO::GpuShaderDescRcPtr shader_desc)
|
||||
{
|
||||
shader_desc_ = shader_desc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
QString shader_id_;
|
||||
|
||||
@@ -96,6 +130,11 @@ private:
|
||||
|
||||
QHash<QString, Texture::Interpolation> interpolation_;
|
||||
|
||||
bool use_ocio_;
|
||||
|
||||
ColorProcessorPtr color_processor_;
|
||||
OCIO::GpuShaderDescRcPtr shader_desc_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "node/block/clip/clip.h"
|
||||
#include "node/block/transition/transition.h"
|
||||
#include "node/color/displaytransform/displaytransform.h"
|
||||
#include "node/project/project.h"
|
||||
#include "rendermanager.h"
|
||||
|
||||
@@ -464,7 +465,7 @@ SampleBufferPtr RenderProcessor::ProcessAudioFootage(const FootageJob &stream, c
|
||||
return super::ProcessAudioFootage(stream, input_time);
|
||||
}
|
||||
|
||||
TexturePtr RenderProcessor::ProcessShader(const Node *node, const TimeRange &range, const ShaderJob &job)
|
||||
TexturePtr RenderProcessor::ProcessShader(const Node *node, const TimeRange &range, ShaderJob &job)
|
||||
{
|
||||
Q_UNUSED(range)
|
||||
|
||||
@@ -475,6 +476,10 @@ TexturePtr RenderProcessor::ProcessShader(const Node *node, const TimeRange &ran
|
||||
QVariant shader = shader_cache_->value(full_shader_id);
|
||||
|
||||
if (shader.isNull()) {
|
||||
if (job.UseOCIO()) {
|
||||
render_ctx_->ShaderJobInsertTextures(job.ColorProcessor(), &job, job.ShaderDesc());
|
||||
}
|
||||
|
||||
// Since we have shader code, compile it now
|
||||
shader = render_ctx_->CreateNativeShader(node->GetShaderCode(job.GetShaderID()));
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ protected:
|
||||
|
||||
virtual SampleBufferPtr ProcessAudioFootage(const FootageJob &stream, const TimeRange &input_time) override;
|
||||
|
||||
virtual TexturePtr ProcessShader(const Node *node, const TimeRange &range, const ShaderJob& job) override;
|
||||
virtual TexturePtr ProcessShader(const Node *node, const TimeRange &range, ShaderJob& job) override;
|
||||
|
||||
virtual SampleBufferPtr ProcessSamples(const Node *node, const TimeRange &range, const SampleJob &job) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user