summaryrefslogtreecommitdiff
path: root/drivers/gles3/rasterizer_storage_gles3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/rasterizer_storage_gles3.cpp')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 8b3f1a1b77..9754cbe0f0 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -1687,6 +1687,17 @@ RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source, int p_
return texture_owner.make_rid(ctex);
}
+Size2 RasterizerStorageGLES3::texture_size_with_proxy(RID p_texture) const {
+
+ const Texture *texture = texture_owner.getornull(p_texture);
+ ERR_FAIL_COND_V(!texture, Size2());
+ if (texture->proxy) {
+ return Size2(texture->proxy->width, texture->proxy->height);
+ } else {
+ return Size2(texture->width, texture->height);
+ }
+}
+
void RasterizerStorageGLES3::texture_set_proxy(RID p_texture, RID p_proxy) {
Texture *texture = texture_owner.get(p_texture);
@@ -7486,7 +7497,7 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
// delete the texture
Shader *shader = shader_owner.get(p_rid);
- if (shader->shader)
+ if (shader->shader && shader->custom_code_id)
shader->shader->free_custom_shader(shader->custom_code_id);
if (shader->dirty_list.in_list())