- Refactor ShaderManager to use RHI abstraction (no bgfx:: exposed) - Implement Option E: inject ShaderHandle via pass constructors - SpritePass/DebugPass now receive shader in constructor - RenderPass::execute() takes IRHIDevice& for dynamic buffer updates - SpritePass::execute() updates instance buffer from FramePacket - Integrate ShaderManager lifecycle in BgfxRendererModule - Add test_22_bgfx_sprites.cpp (visual test with SDL2) - Add test_22_bgfx_sprites_headless.cpp (headless data structure test) - Update PLAN_BGFX_RENDERER.md with Phase 4 completion and Phase 6.5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "../RHI/RHICommandBuffer.h"
|
|
#include "../Frame/FramePacket.h"
|
|
#include <vector>
|
|
|
|
namespace grove {
|
|
|
|
namespace rhi { class IRHIDevice; }
|
|
|
|
// ============================================================================
|
|
// Render Pass Interface
|
|
// ============================================================================
|
|
|
|
class RenderPass {
|
|
public:
|
|
virtual ~RenderPass() = default;
|
|
|
|
// Unique identifier
|
|
virtual const char* getName() const = 0;
|
|
|
|
// Render order (lower = earlier)
|
|
virtual uint32_t getSortOrder() const = 0;
|
|
|
|
// Dependencies (names of passes that must execute before)
|
|
virtual std::vector<const char*> getDependencies() const { return {}; }
|
|
|
|
// Execution - MUST be thread-safe
|
|
// frame: read-only
|
|
// device: for dynamic buffer updates
|
|
// cmd: write-only, thread-local
|
|
virtual void execute(const FramePacket& frame, rhi::IRHIDevice& device, rhi::RHICommandBuffer& cmd) = 0;
|
|
|
|
// Initial setup (load shaders, create buffers)
|
|
virtual void setup(rhi::IRHIDevice& device) = 0;
|
|
|
|
// Cleanup
|
|
virtual void shutdown(rhi::IRHIDevice& device) = 0;
|
|
};
|
|
|
|
} // namespace grove
|