Merge branch 'master' into pr/1875

This commit is contained in:
itsmattkc
2022-04-15 13:24:23 -07:00
268 changed files with 73441 additions and 2576 deletions
+3 -3
View File
@@ -44,7 +44,7 @@ DiskManager::DiskManager()
QString default_dir = default_disk_cache_file.readAll();
if (!default_dir.isEmpty()) {
if (FileFunctions::DirectoryIsValid(default_dir, true)) {
if (FileFunctions::DirectoryIsValid(default_dir)) {
GetOpenFolder(default_dir);
} else {
QMessageBox::warning(nullptr,
@@ -180,7 +180,7 @@ void DiskManager::ShowDiskCacheSettingsDialog(DiskCacheFolder *folder, QWidget *
void DiskManager::ShowDiskCacheSettingsDialog(const QString &path, QWidget *parent)
{
if (!FileFunctions::DirectoryIsValid(path, true)) {
if (!FileFunctions::DirectoryIsValid(path)) {
QMessageBox::critical(parent, tr("Disk Cache Error"),
tr("Failed to open disk cache at \"%1\". Try a different folder.").arg(path));
return;
@@ -274,7 +274,7 @@ void DiskCacheFolder::SetPath(const QString &path)
// Attempt to load existing index file from path
QDir path_dir(path_);
path_dir.mkpath(QStringLiteral("."));
FileFunctions::DirectoryIsValid(path_dir);
index_path_ = path_dir.filePath(QStringLiteral("index"));
+2 -2
View File
@@ -394,8 +394,8 @@ bool FrameHashCache::SaveCacheFrame(const QString &filename, char *data, const V
// Ensure directory is created
QDir cache_dir = QFileInfo(filename).dir();
if (!cache_dir.exists()) {
cache_dir.mkpath(".");
if (!FileFunctions::DirectoryIsValid(cache_dir)) {
return false;
}
// Floating point types are stored in EXR
+5
View File
@@ -48,11 +48,16 @@ public:
void SetRequestedFormat(VideoParams::Format f) { requested_format_ = f; }
const QString &GetColorspace() const { return colorspace_; }
void SetColorspace(const QString &s) { colorspace_ = s; }
private:
AlphaChannelSetting alpha_channel_required_;
VideoParams::Format requested_format_;
QString colorspace_;
};
}
+35 -2
View File
@@ -7,7 +7,7 @@
# Price, Nick Shaw, and Timothy
# Lottes.
ocio_profile_version: 1
ocio_profile_version: 2
search_path: "luts:looks"
strictparsing: true
@@ -16,7 +16,7 @@ luma: [0.2126, 0.7152, 0.0722]
description: A filmlike dynamic range encoding set for Blender
roles:
default: Linear
default: sRGB OETF
reference: Linear
scene_linear: Linear
data: Non-Colour Data
@@ -28,6 +28,7 @@ roles:
color_picking: sRGB OETF
texture_paint: sRGB OETF
matte_paint: Filmic Log Encoding
cie_xyz_d65_interchange: CIE-XYZ D65
displays:
sRGB:
@@ -49,6 +50,8 @@ displays:
active_displays: [sRGB, BT.1886, Apple Display P3, None]
#active_views: [Filmic Log Encoding Base, sRGB OETF, Non-Colour Data, Linear Raw, No View]
inactive_colorspaces: [CIE-XYZ D65]
colorspaces:
- !<ColorSpace>
name: Linear
@@ -61,6 +64,20 @@ colorspaces:
allocation: lg2
allocationvars: [-12.4739311883, 12.5260688117, 0.00392156862]
- !<ColorSpace>
name: CIE-XYZ D65
family: display
equalitygroup: ""
bitdepth: 32f
description: |
Linear CIE XYZ space with D65 white point
isdata: false
allocation: lg2
allocationvars: [-12.4739311883, 12.5260688117, 0.00392156862]
to_reference: !<GroupTransform>
children:
- !<MatrixTransform> {matrix: [0.4124, 0.3576, 0.1805, 0, 0.2126, 0.7152, 0.0722, 0, 0.0193, 0.1192, 0.9505, 0, 0, 0, 0, 1], direction: inverse}
- !<ColorSpace>
name: Filmic Log Encoding
family:
@@ -248,6 +265,22 @@ colorspaces:
- !<FileTransform> {src: V3_LogC_400_to_linear.spi1d, interpolation: linear}
- !<MatrixTransform> {matrix: [1.617523, -0.537287, -0.080237, 0, -0.070573, 1.334613, -0.26404, 0, -0.021102, -0.226954, 1.248056, 0, 0, 0, 0, 1]}
- !<ColorSpace>
name: Blackmagic Film Wide Gamut (Gen 5)
family: Camera Footage
equalitygroup: ""
bitdepth: 32f
description: |
Blackmagic Film Wide Gamut (Gen 5)
isdata: false
allocation: uniform
allocationvars: [0, 1]
to_reference: !<GroupTransform>
children:
- !<FileTransform> {src: Blackmagic_FilmWideGamut_Gen5_to_linear.spi1d, interpolation: linear}
- !<MatrixTransform> {matrix: [0.606530, 0.220408, 0.123479, 0, 0.267989, 0.832731, -0.100720, 0, -0.029442, -0.086611, 1.204861, 0, 0, 0, 0, 1]}
- !<ColorSpaceTransform> {src: CIE-XYZ D65, dst: reference}
- !<ColorSpace>
name: Non-Colour Data
family:
File diff suppressed because it is too large Load Diff
+15 -13
View File
@@ -523,6 +523,7 @@ void OpenGLRenderer::Blit(QVariant s, ShaderJob job, Texture *destination, Video
case NodeValue::kFootageJob:
case NodeValue::kBezier:
case NodeValue::kNone:
case NodeValue::kDataTypeCount:
break;
}
}
@@ -539,13 +540,15 @@ void OpenGLRenderer::Blit(QVariant s, ShaderJob job, Texture *destination, Video
GLenum target = (texture && texture->type() == Texture::k3D) ? GL_TEXTURE_3D : GL_TEXTURE_2D;
functions_->glBindTexture(target, tex_id);
PrepareInputTexture(target, t.interpolation);
if (tex_id) {
PrepareInputTexture(target, t.interpolation);
if (texture && texture->channel_count() == 1 && destination_params.channel_count() != 1) {
// Interpret this texture as a grayscale texture
functions_->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
functions_->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_RED);
functions_->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
if (texture->channel_count() == 1 && destination_params.channel_count() != 1) {
// Interpret this texture as a grayscale texture
functions_->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
functions_->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_RED);
functions_->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED);
}
}
}
@@ -807,6 +810,10 @@ void OpenGLRenderer::PrepareInputTexture(GLenum target, Texture::Interpolation i
functions_->glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
functions_->glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
if (target == GL_TEXTURE_3D) {
functions_->glTexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
}
}
void OpenGLRenderer::ClearDestinationInternal(double r, double g, double b, double a)
@@ -883,14 +890,9 @@ GLuint OpenGLRenderer::GetCachedTexture(int width, int height, int depth, VideoP
GLuint OpenGLRenderer::CompileShader(GLenum type, const QString &code)
{
static const QString shader_preamble =
#ifndef Q_OS_MAC
// Use appropriate GL ES 2.0 shader header
QStringLiteral("#version 100\n\n"
// Use appropriate GL 3.2 shader header
QStringLiteral("#version 150\n\n"
"precision highp float;\n\n");
#else
// Use desktop GL equivalent header because apparently macOS doesn't support the ES header
QStringLiteral("#version 120\n\n");
#endif
QString complete_code;
+10 -3
View File
@@ -378,9 +378,6 @@ void PreviewAutoCacher::AddNode(Node *node)
// Add to project
copy->setParent(&copied_project_);
// Copy UUID
copy->SetUUID(node->GetUUID());
// Insert into map
InsertIntoCopyMap(node, copy);
@@ -420,6 +417,11 @@ void PreviewAutoCacher::RemoveEdge(Node *output, const NodeInput &input)
void PreviewAutoCacher::CopyValue(const NodeInput &input)
{
if (dynamic_cast<NodeGroup*>(input.node())) {
// Group nodes are just dummy nodes, no need to copy them
return;
}
// Copy all values to our graph
Node* our_input = copy_map_.value(input.node());
Node::CopyValuesOfElement(input.node(), our_input, input.input(), input.element());
@@ -427,6 +429,11 @@ void PreviewAutoCacher::CopyValue(const NodeInput &input)
void PreviewAutoCacher::CopyValueHint(const NodeInput &input)
{
if (dynamic_cast<NodeGroup*>(input.node())) {
// Group nodes are just dummy nodes, no need to copy them
return;
}
// Copy value hint to our graph
Node* our_input = copy_map_.value(input.node());
Node::ValueHint hint = input.node()->GetValueHintForInput(input.input(), input.element());
+1 -1
View File
@@ -223,7 +223,7 @@ bool Renderer::GetColorContext(ColorProcessorPtr color_processor, Renderer::Colo
// Create shader description
const char* ocio_func_name = "OCIODisplay";
auto shader_desc = OCIO::GpuShaderDesc::CreateShaderDesc();
shader_desc->setLanguage(OCIO::GPU_LANGUAGE_GLSL_1_3);
shader_desc->setLanguage(OCIO::GPU_LANGUAGE_GLSL_ES_3_0);
shader_desc->setFunctionName(ocio_func_name);
shader_desc->setResourcePrefix("ocio_");
+14 -3
View File
@@ -312,9 +312,11 @@ NodeValueTable RenderProcessor::GenerateBlockTable(const Track *track, const Tim
packed = tp.Pull();
tp.Close();
PlanarProcessor planar;
planar.Open(samples_from_this_block->audio_params());
samples_from_this_block = planar.Convert(packed);
if (!packed.isEmpty()) {
PlanarProcessor planar;
planar.Open(samples_from_this_block->audio_params());
samples_from_this_block = planar.Convert(packed);
}
}
} else {
// Multiply time
@@ -582,6 +584,15 @@ TexturePtr RenderProcessor::ProcessFrameGeneration(const Node *node, const Gener
frame->data(),
frame->linesize_pixels());
if (!job.GetColorspace().isEmpty()) {
// Convert to reference space
TexturePtr dest = render_ctx_->CreateTexture(GetCacheVideoParams());
ColorManager* color_manager = Node::ValueToPtr<ColorManager>(ticket_->property("colormanager"));
ColorProcessorPtr cp = ColorProcessor::Create(color_manager, job.GetColorspace(), color_manager->GetReferenceColorSpace());
render_ctx_->BlitColorManaged(cp, texture, Renderer::kAlphaAssociated, dest.get());
texture = dest;
}
return texture;
}