#pragma once

#include <render/renderpass.h>
#include <render/graph/types.h>

class EngineContext;
class RenderGraph;
class RGPassResources;

// Debug line rendering pass (wire primitives generated by DebugDrawSystem).
// Draws onto either the final LDR target (after tonemap/FXAA) or the HDR draw target
// when tonemapping is disabled.
class DebugDrawPass final : public IRenderPass
{
public:
    void init(EngineContext *context) override;
    void cleanup() override;
    void execute(VkCommandBuffer) override;
    const char *getName() const override { return "DebugDraw"; }

    void register_graph(RenderGraph *graph,
                        RGImageHandle target_color,
                        RGImageHandle depth,
                        bool is_ldr_target);

private:
    void draw_debug(VkCommandBuffer cmd,
                    EngineContext *ctx,
                    const RGPassResources &res,
                    bool is_ldr_target);

    EngineContext *_context = nullptr;
    DeletionQueue _deletionQueue;
};

