rsx: Extend cubemap_unwrap decode to handle cubemaps with mipmaps

This commit is contained in:
kd-11 2026-04-05 23:36:27 +03:00 committed by Ani
parent b700a7abd9
commit 34c26eff68

View File

@ -1731,24 +1731,34 @@ namespace rsx
} }
case deferred_request_command::cubemap_unwrap: case deferred_request_command::cubemap_unwrap:
{ {
rsx::simple_array<copy_region_descriptor> sections(6); rsx::simple_array<copy_region_descriptor> sections(6 * desc.mipmaps);
for (u16 n = 0; n < 6; ++n) for (u16 n = 0, section_id = 0; n < 6; ++n)
{ {
sections[n] = u16 mip_w = desc.width, mip_h = desc.height;
u16 y_offset = static_cast<u16>(desc.slice_h * n);
for (u8 mip = 0; mip < desc.mipmaps; ++mip)
{ {
.src = desc.external_handle, sections[section_id++] =
.xform = surface_transform::coordinate_transform, {
.level = 0, .src = desc.external_handle,
.src_x = 0, .xform = surface_transform::coordinate_transform,
.src_y = static_cast<u16>(desc.slice_h * n), .level = mip,
.dst_x = 0, .src_x = 0,
.dst_y = 0, .src_y = y_offset,
.dst_z = n, .dst_x = 0,
.src_w = desc.width, .dst_y = 0,
.src_h = desc.height, .dst_z = n,
.dst_w = desc.width, .src_w = mip_w,
.dst_h = desc.height .src_h = mip_h,
}; .dst_w = mip_w,
.dst_h = mip_h
};
y_offset += mip_h;
mip_w = std::max<u16>(mip_w / 2, 1);
mip_h = std::max<u16>(mip_h / 2, 1);
}
} }
result = generate_cubemap_from_images(cmd, desc.gcm_format, desc.width, sections, desc.remap); result = generate_cubemap_from_images(cmd, desc.gcm_format, desc.width, sections, desc.remap);