Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/servers/rendering/renderer_rd/effects/vrs.h
10279 views
1
/**************************************************************************/
2
/* vrs.h */
3
/**************************************************************************/
4
/* This file is part of: */
5
/* GODOT ENGINE */
6
/* https://godotengine.org */
7
/**************************************************************************/
8
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10
/* */
11
/* Permission is hereby granted, free of charge, to any person obtaining */
12
/* a copy of this software and associated documentation files (the */
13
/* "Software"), to deal in the Software without restriction, including */
14
/* without limitation the rights to use, copy, modify, merge, publish, */
15
/* distribute, sublicense, and/or sell copies of the Software, and to */
16
/* permit persons to whom the Software is furnished to do so, subject to */
17
/* the following conditions: */
18
/* */
19
/* The above copyright notice and this permission notice shall be */
20
/* included in all copies or substantial portions of the Software. */
21
/* */
22
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29
/**************************************************************************/
30
31
#pragma once
32
33
#include "servers/rendering/renderer_rd/pipeline_cache_rd.h"
34
#include "servers/rendering/renderer_rd/shaders/effects/vrs.glsl.gen.h"
35
36
namespace RendererRD {
37
38
class VRS {
39
private:
40
enum VRSMode {
41
VRS_DEFAULT,
42
VRS_MULTIVIEW,
43
VRS_RG,
44
VRS_RG_MULTIVIEW,
45
VRS_MAX,
46
};
47
48
struct VRSPushConstant {
49
float max_texel_factor; // 4x8, 8x4 and 8x8 are only available on some GPUs.
50
float res1;
51
float res2;
52
float res3;
53
};
54
55
struct VRSShader {
56
// VRSPushConstant push_constant;
57
VrsShaderRD shader;
58
RID shader_version;
59
PipelineCacheRD pipelines[VRS_MAX];
60
} vrs_shader;
61
62
public:
63
VRS();
64
~VRS();
65
66
void copy_vrs(RID p_source_rd_texture, RID p_dest_framebuffer, bool p_multiview = false);
67
68
Size2i get_vrs_texture_size(const Size2i p_base_size) const;
69
void update_vrs_texture(RID p_vrs_fb, RID p_render_target);
70
};
71
72
} // namespace RendererRD
73
74