summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/blit_image.h
blob: 5a2b12d16f8951033b14cbfbf5c3b745c28f674c (plain) (blame)
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
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <glad/glad.h>

#include "video_core/engines/fermi_2d.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/texture_cache/types.h"

namespace OpenGL {

using VideoCommon::Extent3D;
using VideoCommon::Offset2D;
using VideoCommon::Region2D;

class ProgramManager;
class Framebuffer;
class ImageView;

class BlitImageHelper {
public:
    explicit BlitImageHelper(ProgramManager& program_manager);
    ~BlitImageHelper();

    void BlitColor(GLuint dst_framebuffer, GLuint src_image_view, GLuint src_sampler,
                   const Region2D& dst_region, const Region2D& src_region,
                   const Extent3D& src_size);

private:
    ProgramManager& program_manager;

    OGLProgram full_screen_vert;
    OGLProgram blit_color_to_color_frag;
};

} // namespace OpenGL