overload it with a rvalue to allow us to move the data directly avoiding an extra copy. because SRenderData is not trivially copyable.
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#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;
|
|
float blurA = 1.F;
|
|
CRegion damage;
|
|
int round = 0;
|
|
float roundingPower = 2.0f;
|
|
bool flipEndFrame = false;
|
|
std::optional<Mat3x3> replaceProjection;
|
|
CBox clipBox;
|
|
bool blur = false;
|
|
std::optional<float> ignoreAlpha;
|
|
};
|
|
|
|
CTexPassElement(const SRenderData& data);
|
|
CTexPassElement(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 m_data;
|
|
};
|