Add ShaderGen module analysis and incremental refactoring plan#40
Draft
Copilot wants to merge 2 commits intodevel_49_ecsfrom
Draft
Add ShaderGen module analysis and incremental refactoring plan#40Copilot wants to merge 2 commits intodevel_49_ecsfrom
Copilot wants to merge 2 commits intodevel_49_ecsfrom
Conversation
Co-authored-by: hyzboy <1788285+hyzboy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze ShaderGen module and propose refactoring plan
Add ShaderGen module analysis and incremental refactoring plan
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Analyzed the ShaderGen module (51 files, ~5,800 LOC) and created a structured refactoring plan addressing architectural debt while maintaining continuous buildability.
Analysis
Core Components Identified:
ShaderCreateInfohierarchy - per-stage shader generation (Vertex/Geometry/Fragment)MaterialCreateInfo- multi-stage coordinatorMaterialDescriptorInfo/ShaderDescriptorInfo- resource management with auto set/binding allocationGLSLCompiler- SPIR-V compilation via dynamic pluginStdMaterialhierarchy - 2D/3D material frameworkKey Strengths:
Critical Issues:
ShaderCreateInfohandles both generation and compilationRefactoring Plan
25 incremental steps across 8 phases, each step maintains buildability:
Phase 1 (P1) - Foundation: Test harness, structured error reporting, config extraction
Phase 2 (P1) - Generation:
ShaderCodeBuilderabstraction, eliminate direct string opsPhase 3 (P1) - Descriptors: Clarify MDI/SDI split, fluent API, validation
Phase 4 (P1) - Decoupling:
IShaderCompilerinterface, builder pattern, dependency injectionPhase 5 (P2) - Extension: Template system, shader cache, material variants
Phase 6 (P2) - Performance: Object pooling, parallel compilation, profiling
Phase 7 (P3) - Tooling: API docs, shader visualizer, material editor
Phase 8 (P3) - Advanced: Mesh/Task shaders, HLSL support, SPIRV-Tools integration
Example transformation:
Timeline: 3-4 months single-engineer, 1.5-2 months small team
Document:
doc/ShaderGen_Refactoring_Plan.mdOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.