aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/framebuffer_config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/framebuffer_config.cpp')
-rw-r--r--src/video_core/framebuffer_config.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/video_core/framebuffer_config.cpp b/src/video_core/framebuffer_config.cpp
index e28d41f84c..7145b02c07 100644
--- a/src/video_core/framebuffer_config.cpp
+++ b/src/video_core/framebuffer_config.cpp
@@ -1,11 +1,35 @@
+// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
+#include <algorithm>
+
#include "common/assert.h"
#include "video_core/framebuffer_config.h"
namespace Tegra {
+std::span<const FramebufferConfig> FilterLayerStack(
+ std::span<const FramebufferConfig> layers, Service::Nvnflinger::LayerStackId stack,
+ std::vector<FramebufferConfig>& scratch) {
+ const u32 bit = Service::Nvnflinger::LayerStackBit(stack);
+
+ if (std::ranges::all_of(layers,
+ [bit](const auto& layer) { return (layer.layer_stack_mask & bit) != 0; }))
+ return layers;
+
+ scratch.clear();
+ for (const auto& layer : layers) {
+ if ((layer.layer_stack_mask & bit) != 0) {
+ scratch.push_back(layer);
+ }
+ }
+
+ return scratch;
+}
+
Common::Rectangle<f32> NormalizeCrop(const FramebufferConfig& framebuffer, u32 texture_width,
u32 texture_height) {
f32 left, top, right, bottom;