From 4ce37852fe49c8903cea4c5da4ffa212c362bb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cle=CC=81ment=20Foucault?= Date: Mon, 13 Oct 2025 14:35:42 +0200 Subject: [PATCH] GPU: Preprocessor: Remove disabled code before builtin parsing This avoid issues with drw_debug_ prefix being scanned in disabled code. Fixes assert in debug builds. Pull Request: https://projects.blender.org/blender/blender/pulls/147974 --- source/blender/gpu/glsl_preprocess/glsl_preprocess.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh b/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh index 0f37b377b20..da8cc5bfc58 100644 --- a/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh +++ b/source/blender/gpu/glsl_preprocess/glsl_preprocess.hh @@ -212,6 +212,9 @@ class Preprocessor { } str = remove_comments(str, report_error); threadgroup_variables_parsing(str); + if (language == BLENDER_GLSL || language == CPP) { + str = disabled_code_mutation(str, report_error); + } parse_builtins(str, filename); if (language == BLENDER_GLSL || language == CPP) { if (do_parse_function) { @@ -221,7 +224,6 @@ class Preprocessor { pragma_runtime_generated_parsing(str); pragma_once_linting(str, filename, report_error); } - str = disabled_code_mutation(str, report_error); str = include_parse_and_remove(str, report_error); str = pragmas_mutation(str, report_error); str = swizzle_function_mutation(str, report_error);