diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-12-22 17:12:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-22 17:12:09 +0100 |
| commit | e536b02248f370971716b744968776f6880528be (patch) | |
| tree | 5e5755b7894eb44f9259cfe0e1d97899148a8a60 /src/render/pass/SurfacePassElement.hpp | |
| parent | 1cc1a46c2e154a27750b81307040d3bf7ff0f64f (diff) | |
Renderer: rewrite render scheduling (#8683)
This rewrites renderer scheduling. Occlusion is now unified in a new Pass type.
Diffstat (limited to 'src/render/pass/SurfacePassElement.hpp')
| -rw-r--r-- | src/render/pass/SurfacePassElement.hpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/render/pass/SurfacePassElement.hpp b/src/render/pass/SurfacePassElement.hpp new file mode 100644 index 00000000..746c5a64 --- /dev/null +++ b/src/render/pass/SurfacePassElement.hpp @@ -0,0 +1,82 @@ +#pragma once +#include "PassElement.hpp" +#include <optional> + +class CWLSurfaceResource; +class CTexture; +class CSyncTimeline; + +class CSurfacePassElement : public IPassElement { + public: + struct SRenderData { + PHLMONITORREF pMonitor; + timespec* when = nullptr; + Vector2D pos, localPos; + + // for iters + void* data = nullptr; + SP<CWLSurfaceResource> surface = nullptr; + SP<CTexture> texture = nullptr; + bool mainSurface = true; + double w = 0, h = 0; + + // for rounding + bool dontRound = true; + + // for fade + float fadeAlpha = 1.f; + + // for alpha settings + float alpha = 1.f; + + // for decorations (border) + bool decorate = false; + + // for custom round values + int rounding = -1; // -1 means not set + + // for blurring + bool blur = false; + bool blockBlurOptimization = false; + + // only for windows, not popups + bool squishOversized = true; + + // for calculating UV + PHLWINDOW pWindow; + PHLLS pLS; + + bool popup = false; + + // counts how many surfaces this pass has rendered + int surfaceCounter = 0; + + CBox clipBox = {}; // scaled coordinates + + uint32_t discardMode = 0; + float discardOpacity = 0.f; + + bool useNearestNeighbor = false; + + bool flipEndFrame = false; + }; + + CSurfacePassElement(const SRenderData& data); + virtual ~CSurfacePassElement() = 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 "CSurfacePassElement"; + } + + private: + SRenderData data; + + CBox getTexBox(); +};
\ No newline at end of file |
