yuzu/src/video_core/framebuffer_config.h

39 lines
1015 B
C
Raw Normal View History

2022-11-05 16:58:44 +04:00
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "common/common_types.h"
#include "common/math_util.h"
2023-03-04 12:58:45 +04:00
#include "core/hle/service/nvnflinger/buffer_transform_flags.h"
#include "core/hle/service/nvnflinger/pixel_format.h"
2024-02-01 22:47:57 +04:00
#include "core/hle/service/nvnflinger/ui/fence.h"
2022-11-05 16:58:44 +04:00
namespace Tegra {
2024-02-02 20:58:50 +04:00
enum class BlendMode {
Opaque,
Premultiplied,
Coverage,
};
2022-11-05 16:58:44 +04:00
/**
* Struct describing framebuffer configuration
*/
struct FramebufferConfig {
2024-01-07 13:47:31 +04:00
DAddr address{};
2022-11-05 16:58:44 +04:00
u32 offset{};
u32 width{};
u32 height{};
u32 stride{};
Service::android::PixelFormat pixel_format{};
Service::android::BufferTransformFlags transform_flags{};
2024-02-01 22:47:57 +04:00
Common::Rectangle<int> crop_rect{};
2024-02-02 20:58:50 +04:00
BlendMode blending{};
2022-11-05 16:58:44 +04:00
};
2024-02-01 22:47:57 +04:00
Common::Rectangle<f32> NormalizeCrop(const FramebufferConfig& framebuffer, u32 texture_width,
u32 texture_height);
2022-11-05 16:58:44 +04:00
} // namespace Tegra