summaryrefslogtreecommitdiff
path: root/src/render/pass/TexPassElement.hpp
blob: 036b89fe74331deef1ec92c89fb08238568cee13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "PassElement.hpp"
#include <optional>

class CWLSurfaceResource;
class CTexture;
class CSyncTimeline;

class CTexPassElement : public IPassElement {
  public:
    struct SRenderData {
        SP<CTexture>          tex;
        CBox                  box;
        float                 a = 1.F;
        CRegion               damage;
        int                   round         = 0;
        float                 roundingPower = 2.0f;
        bool                  flipEndFrame  = false;
        SP<CSyncTimeline>     syncTimeline;
        int64_t               syncPoint = 0;
        std::optional<Mat3x3> replaceProjection;
    };

    CTexPassElement(const SRenderData& data);
    virtual ~CTexPassElement() = default;

    virtual void                draw(const CRegion& damage);
    virtual bool                needsLiveBlur();
    virtual bool                needsPrecomputeBlur();
    virtual std::optional<CBox> boundingBox();
    virtual CRegion             opaqueRegion();
    virtual void                discard();

    virtual const char*         passName() {
        return "CTexPassElement";
    }

  private:
    SRenderData data;
};