Model preview: AVA2 render-target window on a Vulkan colour target

Port of AVA2's CRenderTarget / GrpRenderTargetTexture / renderTarget module.
The host gains an RGBA8 offscreen colour pass for D3D colour render targets;
mt_preview shows wearable items on every allowed race and monsters with
motions, reached by X+click in the inventory and shop and from the wiki.
Player races are created as TYPE_PC so their parts exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-16 04:48:07 +09:00
co-authored by Claude Opus 5.5
parent 32372c2a73
commit 84404cf1f1
25 changed files with 1602 additions and 34 deletions
+13
View File
@@ -430,6 +430,19 @@ void VulkanWindow::prune_textures() {
it = textures_.erase(it);
} else ++it;
}
// PORT: render targets too (a closed model preview); a later use recreates and clears one.
for (auto it = render_targets_.begin(); it != render_targets_.end();) {
if (frame_number_ - it->second.last_used_frame > static_retention_frames) {
for (auto pair = paired_descriptors_.begin(); pair != paired_descriptors_.end();) {
if (pair->first.find("\n" + it->first + "\n") != std::string::npos) {
vkFreeDescriptorSets(device_, descriptor_pool_, 1, &pair->second.set);
pair = paired_descriptors_.erase(pair);
} else ++pair;
}
release_render_target(it->second);
it = render_targets_.erase(it);
} else ++it;
}
}
} // namespace mt_host