diff options
author | clayjohn <claynjohn@gmail.com> | 2024-05-15 16:30:19 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2024-05-15 16:30:19 -0700 |
commit | c84616c2d2ab9c4af8c2020c17bb9c9a2c14a47f (patch) | |
tree | d170c1033facd1fa2d821670c4b0e2d6495d9ada /servers | |
parent | d4f726f3ef21cef3e7936b2c9770cdac6478b8ee (diff) | |
download | redot-engine-c84616c2d2ab9c4af8c2020c17bb9c9a2c14a47f.tar.gz |
Increase coverage of VRAM debugger and add support to RD backends
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/renderer_rd/storage_rd/texture_storage.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index af30a32866..b577d1a45b 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -1457,6 +1457,23 @@ void TextureStorage::texture_set_detect_roughness_callback(RID p_texture, RS::Te } void TextureStorage::texture_debug_usage(List<RS::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_or_null(E->get()); + if (!t) { + continue; + } + RS::TextureInfo tinfo; + tinfo.path = t->path; + tinfo.format = t->format; + tinfo.width = t->width; + tinfo.height = t->height; + tinfo.depth = t->depth; + tinfo.bytes = Image::get_image_data_size(t->width, t->height, t->format, t->mipmaps); + r_info->push_back(tinfo); + } } void TextureStorage::texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) { @@ -3043,6 +3060,7 @@ void TextureStorage::_update_render_target(RenderTarget *rt) { texture_2d_placeholder_initialize(rt->texture); Texture *tex = get_texture(rt->texture); tex->is_render_target = true; + tex->path = "Render Target (Internal)"; } _clear_render_target(rt); |