diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-10-21 09:50:44 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-10-21 09:50:44 -0300 |
commit | b59c86f6f953ce6957bccbcc1ec6f3ce4c55572d (patch) | |
tree | 39a74205feb03436beacf8c4dcf9d4fd70f2e344 /servers/visual | |
parent | f6a790d58c596773466437140f6d7e2a6a29e5e7 (diff) |
-Ability to debug video memory usage
-Small fix to xml saver (swapping > and <)
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.h | 5 | ||||
-rw-r--r-- | servers/visual/rasterizer_dummy.h | 4 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.cpp | 15 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 5 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 9 |
5 files changed, 37 insertions, 1 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 15c757665b..e22b3c3a6c 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -190,9 +190,12 @@ public: virtual bool texture_has_alpha(RID p_texture) const=0; virtual void texture_set_size_override(RID p_texture,int p_width, int p_height)=0; - virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const=0; + virtual void texture_set_path(RID p_texture,const String& p_path)=0; + virtual String texture_get_path(RID p_texture) const=0; + virtual void texture_debug_usage(List<VS::TextureInfo> *r_info)=0; + /* SHADER API */ virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_MATERIAL)=0; diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h index 9249ad6256..f582fbd8ee 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -415,6 +415,10 @@ public: virtual void texture_set_size_override(RID p_texture,int p_width, int p_height); virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const; + virtual void texture_set_path(RID p_texture,const String& p_path) {} + virtual String texture_get_path(RID p_texture) const { return String(); } + virtual void texture_debug_usage(List<VS::TextureInfo> *r_info) {} + /* SHADER API */ virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_MATERIAL); diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 01af2d86ad..a94d4f64c7 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -112,6 +112,21 @@ void VisualServerRaster::texture_set_reload_hook(RID p_texture,ObjectID p_owner, rasterizer->texture_set_reload_hook(p_texture,p_owner,p_function); } +void VisualServerRaster::texture_set_path(RID p_texture,const String& p_path) { + + rasterizer->texture_set_path(p_texture,p_path); +} + +String VisualServerRaster::texture_get_path(RID p_texture) const{ + + return rasterizer->texture_get_path(p_texture); +} + +void VisualServerRaster::texture_debug_usage(List<TextureInfo> *r_info){ + + rasterizer->texture_debug_usage(r_info); +} + /* SHADER API */ RID VisualServerRaster::shader_create(ShaderMode p_mode) { diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 3d8331984a..b6a5ca6308 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -668,6 +668,11 @@ public: virtual bool texture_can_stream(RID p_texture) const; virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const; + virtual void texture_set_path(RID p_texture,const String& p_path); + virtual String texture_get_path(RID p_texture) const; + + virtual void texture_debug_usage(List<TextureInfo> *r_info); + /* SHADER API */ diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index af88c9bdc9..57d691ae68 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -98,6 +98,15 @@ public: FUNC1RC(bool,texture_can_stream,RID); FUNC3C(texture_set_reload_hook,RID,ObjectID,const StringName&); + FUNC2(texture_set_path,RID,const String&); + FUNC1RC(String,texture_get_path,RID); + + virtual void texture_debug_usage(List<TextureInfo> *r_info) { + //pass directly, should lock the server anyway + visual_server->texture_debug_usage(r_info); + } + + /* SHADER API */ FUNC1R(RID,shader_create,ShaderMode); |