diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-16 09:32:11 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-16 09:32:11 +0200 |
commit | 5708a3a02e00061e03366f2dabf8942df66fedca (patch) | |
tree | 5114deba8f0f9faaa79a9850f2639d18aa47eebe /servers | |
parent | 8663f2715917098a36ba5dc7a392bf0f2993c43b (diff) | |
parent | c84616c2d2ab9c4af8c2020c17bb9c9a2c14a47f (diff) | |
download | redot-engine-5708a3a02e00061e03366f2dabf8942df66fedca.tar.gz |
Merge pull request #92000 from clayjohn/vram-debugger
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 f844919df1..6e5e8f63e0 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) { @@ -3042,6 +3059,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); |