You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Merge pull request #2661 from romulox-x/lowMem2D
Added low_memory_2d_mode
This commit is contained in:
@@ -4075,6 +4075,8 @@ void RasterizerGLES2::render_target_set_size(RID p_render_target,int p_width,int
|
|||||||
glDeleteTextures(1,&rt->color);
|
glDeleteTextures(1,&rt->color);
|
||||||
|
|
||||||
rt->fbo=0;
|
rt->fbo=0;
|
||||||
|
rt->depth=0;
|
||||||
|
rt->color=0;
|
||||||
rt->width=0;
|
rt->width=0;
|
||||||
rt->height=0;
|
rt->height=0;
|
||||||
rt->texture_ptr->tex_id=0;
|
rt->texture_ptr->tex_id=0;
|
||||||
@@ -4094,12 +4096,14 @@ void RasterizerGLES2::render_target_set_size(RID p_render_target,int p_width,int
|
|||||||
glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo);
|
||||||
|
|
||||||
//depth
|
//depth
|
||||||
|
if (!low_memory_2d) {
|
||||||
glGenRenderbuffers(1, &rt->depth);
|
glGenRenderbuffers(1, &rt->depth);
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, rt->depth );
|
glBindRenderbuffer(GL_RENDERBUFFER, rt->depth );
|
||||||
|
|
||||||
glRenderbufferStorage(GL_RENDERBUFFER, use_depth24?_DEPTH_COMPONENT24_OES:GL_DEPTH_COMPONENT16, rt->width,rt->height);
|
glRenderbufferStorage(GL_RENDERBUFFER, use_depth24?_DEPTH_COMPONENT24_OES:GL_DEPTH_COMPONENT16, rt->width,rt->height);
|
||||||
|
|
||||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth);
|
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth);
|
||||||
|
}
|
||||||
|
|
||||||
//color
|
//color
|
||||||
glGenTextures(1, &rt->color);
|
glGenTextures(1, &rt->color);
|
||||||
@@ -10293,7 +10297,11 @@ void RasterizerGLES2::_update_framebuffer() {
|
|||||||
framebuffer.fbo=0;
|
framebuffer.fbo=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TOOLS_ENABLED
|
||||||
framebuffer.active=use_fbo;
|
framebuffer.active=use_fbo;
|
||||||
|
#else
|
||||||
|
framebuffer.active=use_fbo && !low_memory_2d;
|
||||||
|
#endif
|
||||||
framebuffer.width=dwidth;
|
framebuffer.width=dwidth;
|
||||||
framebuffer.height=dheight;
|
framebuffer.height=dheight;
|
||||||
framebuffer.scale=scale;
|
framebuffer.scale=scale;
|
||||||
@@ -11203,6 +11211,7 @@ RasterizerGLES2::RasterizerGLES2(bool p_compress_arrays,bool p_keep_ram_copy,boo
|
|||||||
use_fp16_fb=bool(GLOBAL_DEF("rasterizer/fp16_framebuffer",true));
|
use_fp16_fb=bool(GLOBAL_DEF("rasterizer/fp16_framebuffer",true));
|
||||||
use_shadow_mapping=true;
|
use_shadow_mapping=true;
|
||||||
use_fast_texture_filter=!bool(GLOBAL_DEF("rasterizer/trilinear_mipmap_filter",true));
|
use_fast_texture_filter=!bool(GLOBAL_DEF("rasterizer/trilinear_mipmap_filter",true));
|
||||||
|
low_memory_2d=bool(GLOBAL_DEF("rasterizer/low_memory_2d_mode",false));
|
||||||
skel_default.resize(1024*4);
|
skel_default.resize(1024*4);
|
||||||
for(int i=0;i<1024/3;i++) {
|
for(int i=0;i<1024/3;i++) {
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class RasterizerGLES2 : public Rasterizer {
|
|||||||
float anisotropic_level;
|
float anisotropic_level;
|
||||||
|
|
||||||
bool use_half_float;
|
bool use_half_float;
|
||||||
|
bool low_memory_2d;
|
||||||
|
|
||||||
Vector<float> skel_default;
|
Vector<float> skel_default;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user