diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-02-24 00:32:34 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-02-24 00:33:22 -0300 |
commit | ab8f3d7842976b7fccc6df7abe11d13b44a134f9 (patch) | |
tree | b46c0ba87db9dcb1c9f04a51d807d723badc28f7 /drivers | |
parent | 4ebb544ffacdbf0c3fc190bdfe1448a26e05782c (diff) |
Fixed issue with buffers being wrongly cleared, closes #25484
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 9def9d27e7..c02eeaa0ee 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1028,6 +1028,11 @@ void RasterizerStorageGLES2::sky_set_texture(RID p_sky, RID p_panorama, int p_ra for (int i = 0; i < 6; i++) { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _cube_side_enum[i], sky->radiance, lod); + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + break; //may be too small + } + glViewport(0, 0, size, size); bind_quad_array(); @@ -2209,6 +2214,8 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, VS: glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, surface->index_id); glBufferData(GL_ELEMENT_ARRAY_BUFFER, index_array_size, ir.ptr(), GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + } else { + surface->index_id = 0; } // TODO generate wireframes |