From d438ac0aeda8509e5961296a5950c2755ba8a966 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 4 Dec 2017 15:55:20 -0300 Subject: -Implemented Proxy Textures (needed to solve the problem with ViewportTexture) -Properly use hierarchy to initialize resources local to scene (solves problem of GUI in 3D) --- drivers/gles3/rasterizer_storage_gles3.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'drivers/gles3/rasterizer_storage_gles3.cpp') diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 7e3d21adbb..cba9f08537 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -1232,6 +1232,25 @@ RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source, int p_ return texture_owner.make_rid(ctex); } +void RasterizerStorageGLES3::texture_set_proxy(RID p_texture, RID p_proxy) { + + Texture *texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + if (texture->proxy) { + texture->proxy->proxy_owners.erase(texture); + texture->proxy = NULL; + } + + if (p_proxy.is_valid()) { + Texture *proxy = texture_owner.get(p_proxy); + ERR_FAIL_COND(!proxy); + ERR_FAIL_COND(proxy == texture); + proxy->proxy_owners.insert(texture); + texture->proxy = proxy; + } +} + RID RasterizerStorageGLES3::sky_create() { Sky *sky = memnew(Sky); @@ -1617,7 +1636,6 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const { shaders.actions_scene.render_mode_values["cull_back"] = Pair(&p_shader->spatial.cull_mode, Shader::Spatial::CULL_MODE_BACK); shaders.actions_scene.render_mode_values["cull_disabled"] = Pair(&p_shader->spatial.cull_mode, Shader::Spatial::CULL_MODE_DISABLED); - shaders.actions_scene.render_mode_flags["unshaded"] = &p_shader->spatial.unshaded; shaders.actions_scene.render_mode_flags["depth_test_disable"] = &p_shader->spatial.no_depth_test; -- cgit v1.2.3