Merge branch 'blender-v5.0-release'

This commit is contained in:
Aras Pranckevicius
2025-10-13 09:53:37 +03:00
3 changed files with 14 additions and 2 deletions

View File

@@ -93,7 +93,10 @@ void FallbackGPUShaderBinder::construct_scene_linear_shader(
const std::string fragment_source = generate_scene_linear_fragment_source(display_shader);
if (!create_gpu_shader(display_shader, fragment_source, {{"USE_TO_SCENE_LINEAR_ONLY", ""}})) {
if (!create_gpu_shader(display_shader,
fragment_source,
{{"USE_TO_SCENE_LINEAR_ONLY", ""}, {"OUTPUT_PREMULTIPLIED", ""}}))
{
display_shader.is_valid = false;
}
}

View File

@@ -261,7 +261,10 @@ void LibOCIOGPUShaderBinder::construct_scene_linear_shader(
}
construct_shader_for_processors(
display_shader, processor_to_scene_linear, nullptr, {{"USE_TO_SCENE_LINEAR_ONLY", ""}});
display_shader,
processor_to_scene_linear,
nullptr,
{{"USE_TO_SCENE_LINEAR_ONLY", ""}, {"OUTPUT_PREMULTIPLIED", ""}});
}
} // namespace blender::ocio

View File

@@ -243,6 +243,12 @@ float4 OCIO_ProcessColor(float4 col, float4 col_overlay)
}
#endif
#ifdef OUTPUT_PREMULTIPLIED
if (col.a > 0.0 && col.a < 1.0) {
col.rgb *= col.a;
}
#endif
return col;
}