You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Engine.Graphics.Vulkan.ShaderCode exports fontFragmentShaderCode, an
18-line GLSL fragment shader documented as -- | Legacy font fragment shader (non-SDF, kept for compatibility). It has no consumers:
The module's other seven shader exports each have a real consumer: Engine/Graphics/Font/Draw.hs for the three font shaders, Engine/Graphics/Vulkan/Pipeline/Bindless.hs for the four bindless shaders.
The font pipeline builder hard-codes the SDF shader — Font/Draw.hs:135, fragModule ← createShaderModule device zero { code = fontSDFFragmentShaderCode } Nothing — and both the world pipeline
(createFontPipeline, line 111) and the UI pipeline (line 324) reach it.
No branch, flag, or config can select the legacy shader.
The "compatibility" it claims is with the non-SDF font atlas path, which is
itself unreachable: every font load in the engine goes through loadSDFFont
(Engine/Scripting/Lua/Message/Texture.hs:313), the sole implementation
behind the Lua loadFont registration, which also discards the requested
size. Engine.Graphics.Font.Load.loadFont and Engine.Graphics.Font.Atlas.generateFontAtlas have no callers.
Because [frag| … |] is a Template Haskell quasi-quote that runs glslang at
compile time, the dead shader is recompiled on every rebuild of the module.
Because the binding is exported, GHC's unused-binding warning cannot see it,
which is why -Wall -Werror has never flagged it.
Requirements
fontFragmentShaderCode no longer exists in src/Engine/Graphics/Vulkan/ShaderCode.hs — not the binding, not its
Haddock, not its entry in the module export list.
The module's remaining seven shader exports are unchanged and each still
has its existing consumer.
The change touches exactly one file, and the library and executable build
warning-clean.
Font rendering behaviour is unchanged: the SDF fragment shader remains the
only fragment shader either font pipeline creates.
Acceptance
rg -n 'fontFragmentShaderCode' src/ app/ test/ test-headless/ # no matches
cabal build all
Out of scope
The unreachable non-SDF font atlas path (Font/Load.hs's loadFont, Font/Atlas.hs's generateFontAtlas and renderGlyphWithMetrics, Font/STB.hs's renderSTBGlyph, and the cbits/font_stb.c renderer behind
them). Verified unreachable, but removing it cascades through the FFI layer
and belongs with the dead-export cleanup (report CH-54), not here.
Background
Engine.Graphics.Vulkan.ShaderCodeexportsfontFragmentShaderCode, an18-line GLSL fragment shader documented as
-- | Legacy font fragment shader (non-SDF, kept for compatibility). It has no consumers:The module's other seven shader exports each have a real consumer:
Engine/Graphics/Font/Draw.hsfor the three font shaders,Engine/Graphics/Vulkan/Pipeline/Bindless.hsfor the four bindless shaders.The font pipeline builder hard-codes the SDF shader —
Font/Draw.hs:135,fragModule ← createShaderModule device zero { code = fontSDFFragmentShaderCode } Nothing— and both the world pipeline(
createFontPipeline, line 111) and the UI pipeline (line 324) reach it.No branch, flag, or config can select the legacy shader.
The "compatibility" it claims is with the non-SDF font atlas path, which is
itself unreachable: every font load in the engine goes through
loadSDFFont(
Engine/Scripting/Lua/Message/Texture.hs:313), the sole implementationbehind the Lua
loadFontregistration, which also discards the requestedsize.
Engine.Graphics.Font.Load.loadFontandEngine.Graphics.Font.Atlas.generateFontAtlashave no callers.Because
[frag| … |]is a Template Haskell quasi-quote that runs glslang atcompile time, the dead shader is recompiled on every rebuild of the module.
Because the binding is exported, GHC's unused-binding warning cannot see it,
which is why
-Wall -Werrorhas never flagged it.Requirements
fontFragmentShaderCodeno longer exists insrc/Engine/Graphics/Vulkan/ShaderCode.hs— not the binding, not itsHaddock, not its entry in the module export list.
has its existing consumer.
warning-clean.
only fragment shader either font pipeline creates.
Acceptance
Out of scope
Font/Load.hs'sloadFont,Font/Atlas.hs'sgenerateFontAtlasandrenderGlyphWithMetrics,Font/STB.hs'srenderSTBGlyph, and thecbits/font_stb.crenderer behindthem). Verified unreachable, but removing it cascades through the FFI layer
and belongs with the dead-export cleanup (report CH-54), not here.
UniformBufferObjectduplication across this module's other GLSL blocks(report CH-35, blocked on Give the bindless texture-array and handle-table sizes a single definition #975).
Related
docs/code_health_findings.mdCH-36 (batch 3,src/Engine/Graphics/).