summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-08-06 14:56:06 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-08-06 14:56:06 -0300
commitedde52c8dea0193111239b6b2f002adcc24ac0c9 (patch)
tree8aa3f65b49956fa3f7c3ab765509f2f07b7b6c6c /drivers/gles3
parent80a8636aa3739822b1ebbbad39f932a176ec158d (diff)
Added proper import support for 3D and Array textures
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp6
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h2
2 files changed, 6 insertions, 2 deletions
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;