diff options
Diffstat (limited to 'drivers/gles2/rasterizer_storage_gles2.cpp')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 26c89a0339..697d357a7d 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -370,13 +370,17 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_ switch (p_type) { case VS::TEXTURE_TYPE_2D: { texture->target = GL_TEXTURE_2D; + texture->images.resize(1); } break; case VS::TEXTURE_TYPE_CUBEMAP: { texture->target = GL_TEXTURE_CUBE_MAP; + texture->images.resize(6); } break; case VS::TEXTURE_TYPE_2D_ARRAY: { + texture->images.resize(p_depth_3d); } break; case VS::TEXTURE_TYPE_3D: { + texture->images.resize(p_depth_3d); } break; } @@ -419,7 +423,7 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p bool compressed = false; if (config.keep_original_textures && !(texture->flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING)) { - texture->images[p_layer] = p_image; + texture->images.write[p_layer] = p_image; } Ref<Image> img = _get_gl_image_and_format(p_image, p_image->get_format(), texture->flags, format, internal_format, type, compressed); |