GPU: Improve the do_static_compilation_ check coverage (2)

162a24e05d had to be reverted, since it
didn't take into account other types of dynamically generated
`ShaderCreateInfo` (external shaders like OCIO or Python ones).
This just marks `ShaderCreateInfo`s as generated by default and only
sets the ones from gpu_shader_create_info_list as non generated.

Pull Request: https://projects.blender.org/blender/blender/pulls/145128
This commit is contained in:
Miguel Pozo
2025-08-27 20:17:04 +02:00
parent ddb4aa2595
commit 0cf4d39aa9
3 changed files with 5 additions and 0 deletions

View File

@@ -660,6 +660,7 @@ Shader *ShaderCompiler::compile(const shader::ShaderCreateInfo &info, bool is_ba
using namespace blender::gpu::shader;
const_cast<ShaderCreateInfo &>(info).finalize();
BLI_assert(info.do_static_compilation_ || info.is_generated_);
TimePoint start_time;

View File

@@ -535,6 +535,8 @@ void gpu_shader_create_info_init()
}
for (ShaderCreateInfo *info : g_create_infos->values()) {
info->is_generated_ = false;
info->builtins_ |= gpu_shader_dependency_get_builtins(info->vertex_source_);
info->builtins_ |= gpu_shader_dependency_get_builtins(info->fragment_source_);
info->builtins_ |= gpu_shader_dependency_get_builtins(info->geometry_source_);

View File

@@ -687,6 +687,8 @@ struct ShaderCreateInfo {
StringRefNull name_;
/** True if the shader is static and can be pre-compiled at compile time. */
bool do_static_compilation_ = false;
/** True if the shader is not part of gpu_shader_create_info_list. */
bool is_generated_ = true;
/** If true, all additionally linked create info will be merged into this one. */
bool finalized_ = false;
/** If true, all resources will have an automatic location assigned. */