fix: preserve D3D texture addressing in native UI sampling

This commit is contained in:
shen
2026-10-18 03:49:11 -07:00
parent fe6e41dc8e
commit b61140b8f4
13 changed files with 94 additions and 9 deletions
+14 -1
View File
@@ -195,7 +195,20 @@ VkDescriptorSet VulkanWindow::get_texture_descriptor(
VkDescriptorSet VulkanWindow::get_ui_texture_descriptor(
const std::string& texture0_name,
const std::string& mask_name,
const std::unordered_map<std::string, std::vector<std::uint8_t>>& capture_textures, bool point) {
const std::unordered_map<std::string, std::vector<std::uint8_t>>& capture_textures, bool point,
std::uint32_t address_u,std::uint32_t address_v) {
if(address_u!=3 || address_v!=3) {
// 40250 ExpandedImage uses the current D3D8 addressing state. Board backgrounds tile;
// clamping them stretches the edge texels into stripes. Reuse the existing sampler cache.
Render3DDraw state{};
state.address_u[0]=address_u; state.address_v[0]=address_v;
state.address_u[1]=state.address_v[1]=3;
for(int i=0;i<2;++i) {
state.min_filter[i]=state.mag_filter[i]=point?1:2;
state.mip_filter[i]=0; // UI remains at mip zero, including the HD archive.
}
return get_texture_descriptor(texture0_name,mask_name,capture_textures,state);
}
auto& tex0 = get_gpu_texture(texture0_name, capture_textures);
if (point && mask_name.empty() && tex0.view) {
if (!tex0.ui_point_descriptor)