vk: Allow cubemap unwrap to generate more than 1 mipmap level
This commit is contained in:
@@ -471,6 +471,10 @@ void VKGSRender::load_texture_env()
|
|||||||
// Clamp min and max lod
|
// Clamp min and max lod
|
||||||
actual_mipmaps = static_cast<f32>(sampler_state->external_subresource_desc.sections_to_copy.size());
|
actual_mipmaps = static_cast<f32>(sampler_state->external_subresource_desc.sections_to_copy.size());
|
||||||
}
|
}
|
||||||
|
else if (sampler_state->external_subresource_desc.op == rsx::deferred_request_command::cubemap_unwrap)
|
||||||
|
{
|
||||||
|
actual_mipmaps = static_cast<f32>(sampler_state->external_subresource_desc.mipmaps);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actual_mipmaps = 1.f;
|
actual_mipmaps = 1.f;
|
||||||
|
|||||||
@@ -761,8 +761,9 @@ namespace vk
|
|||||||
const rsx::simple_array<copy_region_descriptor>& sections_to_copy, const rsx::texture_channel_remap_t& remap_vector)
|
const rsx::simple_array<copy_region_descriptor>& sections_to_copy, const rsx::texture_channel_remap_t& remap_vector)
|
||||||
{
|
{
|
||||||
auto _template = get_template_from_collection_impl(sections_to_copy);
|
auto _template = get_template_from_collection_impl(sections_to_copy);
|
||||||
|
const u8 mip_count = 1 + sections_to_copy.reduce(0, FN(std::max<u8>(x, y.level)));
|
||||||
auto result = create_temporary_subresource_view_impl(cmd, _template, VK_IMAGE_TYPE_2D,
|
auto result = create_temporary_subresource_view_impl(cmd, _template, VK_IMAGE_TYPE_2D,
|
||||||
VK_IMAGE_VIEW_TYPE_CUBE, gcm_format, 0, 0, size, size, 1, 1, remap_vector, false);
|
VK_IMAGE_VIEW_TYPE_CUBE, gcm_format, 0, 0, size, size, 1, mip_count, remap_vector, false);
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
@@ -772,7 +773,7 @@ namespace vk
|
|||||||
|
|
||||||
const auto image = result->image();
|
const auto image = result->image();
|
||||||
VkImageAspectFlags dst_aspect = vk::get_aspect_flags(result->info.format);
|
VkImageAspectFlags dst_aspect = vk::get_aspect_flags(result->info.format);
|
||||||
VkImageSubresourceRange dst_range = { dst_aspect, 0, 1, 0, 6 };
|
VkImageSubresourceRange dst_range = { dst_aspect, 0, mip_count, 0, 6 };
|
||||||
vk::change_image_layout(cmd, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, dst_range);
|
vk::change_image_layout(cmd, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, dst_range);
|
||||||
|
|
||||||
if (!(dst_aspect & VK_IMAGE_ASPECT_DEPTH_BIT))
|
if (!(dst_aspect & VK_IMAGE_ASPECT_DEPTH_BIT))
|
||||||
|
|||||||
Reference in New Issue
Block a user