diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 6 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.h | 2 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 6 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 2 |
4 files changed, 12 insertions, 4 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); diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index b79e87633d..8bc3369dbb 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -258,7 +258,7 @@ public: RenderTarget *render_target; - Ref<Image> images[6]; + Vector<Ref<Image> > images; bool redraw_if_visible; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 83792ca19f..a5c81d6c4d 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -622,15 +622,19 @@ void RasterizerStorageGLES3::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->target = GL_TEXTURE_2D_ARRAY; + texture->images.resize(p_depth_3d); } break; case VS::TEXTURE_TYPE_3D: { texture->target = GL_TEXTURE_3D; + texture->images.resize(p_depth_3d); } break; } @@ -703,7 +707,7 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p bool srgb; 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, srgb); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 5b8b524021..f55c8026ea 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -277,7 +277,7 @@ public: RenderTarget *render_target; - Ref<Image> images[6]; + Vector<Ref<Image> > images; VisualServer::TextureDetectCallback detect_3d; void *detect_3d_ud; |