summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_gles2.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-10-21 09:50:44 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-10-21 09:50:44 -0300
commitb59c86f6f953ce6957bccbcc1ec6f3ce4c55572d (patch)
tree39a74205feb03436beacf8c4dcf9d4fd70f2e344 /drivers/gles2/rasterizer_gles2.cpp
parentf6a790d58c596773466437140f6d7e2a6a29e5e7 (diff)
-Ability to debug video memory usage
-Small fix to xml saver (swapping > and <)
Diffstat (limited to 'drivers/gles2/rasterizer_gles2.cpp')
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index c36f99d78d..d84ee5a758 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -1408,6 +1408,40 @@ GLuint RasterizerGLES2::_texture_get_name(RID p_tex) {
return texture->tex_id;
};
+void RasterizerGLES2::texture_set_path(RID p_texture,const String& p_path) {
+ Texture * texture = texture_owner.get(p_texture);
+ ERR_FAIL_COND(!texture);
+
+ texture->path=p_path;
+
+}
+
+String RasterizerGLES2::texture_get_path(RID p_texture) const{
+
+ Texture * texture = texture_owner.get(p_texture);
+ ERR_FAIL_COND_V(!texture,String());
+ return texture->path;
+}
+void RasterizerGLES2::texture_debug_usage(List<VS::TextureInfo> *r_info){
+
+ List<RID> textures;
+ texture_owner.get_owned_list(&textures);
+
+ for (List<RID>::Element *E=textures.front();E;E=E->next()) {
+
+ Texture *t = texture_owner.get(E->get());
+ if (!t)
+ continue;
+ VS::TextureInfo tinfo;
+ tinfo.path=t->path;
+ tinfo.format=t->format;
+ tinfo.size.x=t->alloc_width;
+ tinfo.size.y=t->alloc_height;
+ tinfo.bytes=t->total_data_size;
+ r_info->push_back(tinfo);
+ }
+
+}
/* SHADER API */