summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/renderer_compositor_rd.cpp
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2021-03-10 22:23:55 +1100
committerBastiaan Olij <mux213@gmail.com>2021-05-03 21:54:11 +1000
commit58ff0dac1a3ff800128582575f2b9b1b95e40962 (patch)
tree7d9b0ba25eb7b9b116b9a4aa3a780df5ba1e193b /servers/rendering/renderer_rd/renderer_compositor_rd.cpp
parenta4afa05efefba62673dfce2055cdf9bc9187905e (diff)
Create mobile renderer
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_compositor_rd.cpp')
-rw-r--r--servers/rendering/renderer_rd/renderer_compositor_rd.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp
index 2247b841c9..cb3e67e990 100644
--- a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp
@@ -175,5 +175,14 @@ RendererCompositorRD::RendererCompositorRD() {
storage = memnew(RendererStorageRD);
canvas = memnew(RendererCanvasRenderRD(storage));
- scene = memnew(RendererSceneRenderImplementation::RenderForwardClustered(storage));
+
+ uint32_t back_end = GLOBAL_GET("rendering/vulkan/rendering/back_end");
+ uint32_t textures_per_stage = RD::get_singleton()->limit_get(RD::LIMIT_MAX_TEXTURES_PER_SHADER_STAGE);
+
+ if (back_end == 1 || textures_per_stage < 48) {
+ scene = memnew(RendererSceneRenderImplementation::RenderForwardMobile(storage));
+ } else { // back_end == 0
+ // default to our high end renderer
+ scene = memnew(RendererSceneRenderImplementation::RenderForwardClustered(storage));
+ }
}