Fix CustomMaterial NORMAL not applied in debug passes


When DebugSettings.materialOverride is set to Normals (or any other
debug mode), the CustomMaterial MAIN() function was never called. This
meant any modifications to the NORMAL variable — including TBN-space
normal map sampling that uses TANGENT and BINORMAL — were silently
ignored in debug visualizations.

The regression was introduced by commit 88d40f994 ("DefaultMaterial
Shader Generator cleanup"), which replaced the old bool flag
`includeCustomFragmentMain` (true by default, false only for depth
passes) with shouldIncludeCustomFragmentMain(), which checks material
property flags like needsBaseColor/needsRoughness/etc.  In debug
passes none of those flags are set, so the function returned false and
qt_customMain() was never emitted into the generated shader.

Fix: return true immediately when passType == Debug, restoring the
Qt 6.10.2 behavior where debug passes always include the custom
fragment main so that material-derived NORMAL values are visible in
debug overlays.

Fixes: QTBUG-145056
Pick-to: 6.11
Change-Id: Id932b49c3926ffa63856c391f3786ea365f8e535
Reviewed-by: Andrei Yankovich <EndrIIMail@gmail.com>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
commitfff81ea6c77eff7cfb7f3928666ea37d3b16e5d7
parentffd3ffa04a2cca1177245fc5af5956cb966cb7b7
authorAndy Nichols <andy.nichols@qt.io>
committerAndy Nichols <andy.nichols@qt.io>
commit timeTue, 31 Mar 2026 14:24:00 +0100