diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-08-27 10:12:39 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-27 10:12:39 -0300 |
commit | eb25cd0737612c1dc03b3757b18cea85cb8afc74 (patch) | |
tree | f83f5cb5f5ba64dd2b8caf42f2b5e76e0c6f0a86 /drivers/gles2 | |
parent | 87725e891d71b7d429ef54f63312cbfebb7c660a (diff) | |
parent | bca706b36138599e383c04fb502285bc97ca09bf (diff) |
Merge pull request #21483 from godotengine/revert-21467-fix-3d-textures
Revert "Fix some 3D texture issues"
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 19 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.h | 4 |
2 files changed, 5 insertions, 18 deletions
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 22e56fbb09..3cee42983d 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -365,7 +365,6 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_ ERR_FAIL_COND(!texture); texture->width = p_width; texture->height = p_height; - texture->depth = 0; texture->format = p_format; texture->flags = p_flags; texture->stored_cube_sides = 0; @@ -385,7 +384,6 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_ } break; case VS::TEXTURE_TYPE_3D: { texture->images.resize(p_depth_3d); - texture->depth = p_depth_3d; } break; default: { ERR_PRINT("Unknown texture type!"); @@ -398,7 +396,6 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_ texture->alloc_width = texture->width; texture->alloc_height = texture->height; - texture->alloc_depth = texture->depth; texture->gl_format_cache = format; texture->gl_type_cache = type; @@ -594,9 +591,7 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer) PoolVector<uint8_t> data; - int alloc_depth = MAX(texture->alloc_depth, 1); - - int data_size = Image::get_image_data_size(texture->alloc_width, texture->alloc_height, real_format, texture->mipmaps > 1 ? -1 : 0) * alloc_depth; + int data_size = Image::get_image_data_size(texture->alloc_width, texture->alloc_height, real_format, texture->mipmaps > 1 ? -1 : 0); data.resize(data_size * 2); //add some memory at the end, just in case for buggy drivers PoolVector<uint8_t>::Write wb = data.write(); @@ -625,7 +620,7 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer) wb = PoolVector<uint8_t>::Write(); - data.resize(data_size / alloc_depth); + data.resize(data_size); Image *img = memnew(Image(texture->alloc_width, texture->alloc_height, texture->mipmaps > 1 ? true : false, real_format, data)); @@ -785,7 +780,7 @@ void RasterizerStorageGLES2::texture_debug_usage(List<VS::TextureInfo> *r_info) tinfo.format = t->format; tinfo.width = t->alloc_width; tinfo.height = t->alloc_height; - tinfo.depth = t->alloc_depth; + tinfo.depth = 0; tinfo.bytes = t->total_data_size; r_info->push_back(tinfo); } @@ -3667,8 +3662,6 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) { texture->alloc_width = rt->width; texture->height = rt->height; texture->alloc_height = rt->height; - texture->depth = 0; - texture->alloc_depth = 0; texture->active = true; texture_set_flags(rt->texture, texture->flags); @@ -3716,8 +3709,6 @@ void RasterizerStorageGLES2::_render_target_clear(RenderTarget *rt) { Texture *tex = texture_owner.get(rt->texture); tex->alloc_height = 0; tex->alloc_width = 0; - tex->alloc_depth = 0; - tex->depth = 0; tex->width = 0; tex->height = 0; tex->active = false; @@ -3741,10 +3732,8 @@ RID RasterizerStorageGLES2::render_target_create() { t->flags = 0; t->width = 0; t->height = 0; - t->depth = 0; - t->alloc_width = 0; t->alloc_height = 0; - t->alloc_depth = 0; + t->alloc_width = 0; t->format = Image::FORMAT_R8; t->target = GL_TEXTURE_2D; t->gl_format_cache = 0; diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index c3066b754d..88783d7160 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -232,7 +232,7 @@ public: String path; uint32_t flags; int width, height, depth; - int alloc_width, alloc_height, alloc_depth; + int alloc_width, alloc_height; Image::Format format; VS::TextureType type; @@ -275,10 +275,8 @@ public: flags = 0; width = 0; height = 0; - depth = 0; alloc_width = 0; alloc_height = 0; - alloc_depth = 0; format = Image::FORMAT_L8; target = 0; |