summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-12 19:23:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-06-12 19:23:37 -0300
commit831860695c8404720f4b7d2e0a4d93ad2f308c21 (patch)
treeaa1d356b211d91d5b9da76d6fc6952f468dcf6a2 /drivers
parent41c3ca358e1b4c6d4a3bcbd1a158f20cb0016e4e (diff)
Fix empty shader related crash, closes #8314
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp2
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 08f15a9b84..87347b8d95 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2113,7 +2113,7 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
if (m_src.is_valid()) {
m = storage->material_owner.getornull(m_src);
- if (!m->shader) {
+ if (!m->shader || !m->shader->valid) {
m = NULL;
}
}
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 54e99eb622..858c543785 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -1425,6 +1425,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
_shader_dirty_list.remove(&p_shader->dirty_list);
p_shader->valid = false;
+ p_shader->ubo_size = 0;
p_shader->uniforms.clear();
@@ -2244,6 +2245,10 @@ void RasterizerStorageGLES3::_update_material(Material *material) {
if (material->shader && material->shader->dirty_list.in_list()) {
_update_shader(material->shader);
}
+
+ if (material->shader && !material->shader->valid)
+ return;
+
//update caches
{