mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-11-18 15:42:43 +01:00
[TEST] Miscellaneous changes
This commit is contained in:
parent
b59dda3af6
commit
0fb0592a5f
4 changed files with 24 additions and 33 deletions
|
|
@ -1992,10 +1992,10 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset,
|
||||||
image_copies.push_back(image_copy);
|
image_copies.push_back(image_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runtime->TransitionImageLayout(*this);
|
||||||
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, Handle(), info.format,
|
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, Handle(), info.format,
|
||||||
temp_vk_image, info.format, info.num_samples,
|
temp_vk_image, info.format, info.num_samples,
|
||||||
image_copies, false);
|
image_copies, false);
|
||||||
initialized = true;
|
|
||||||
runtime->pending_msaa_images.emplace_back(scheduler->CurrentTick(), std::move(temp_image));
|
runtime->pending_msaa_images.emplace_back(scheduler->CurrentTick(), std::move(temp_image));
|
||||||
|
|
||||||
if (is_rescaled) {
|
if (is_rescaled) {
|
||||||
|
|
@ -2006,6 +2006,9 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset,
|
||||||
|
|
||||||
if (info.num_samples > 1) {
|
if (info.num_samples > 1) {
|
||||||
LOG_WARNING(Render_Vulkan, "MSAA upload not implemented for format {}", info.format);
|
LOG_WARNING(Render_Vulkan, "MSAA upload not implemented for format {}", info.format);
|
||||||
|
if (runtime != nullptr) {
|
||||||
|
runtime->TransitionImageLayout(*this);
|
||||||
|
}
|
||||||
if (is_rescaled) {
|
if (is_rescaled) {
|
||||||
ScaleUp();
|
ScaleUp();
|
||||||
}
|
}
|
||||||
|
|
@ -2588,14 +2591,15 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||||
Shader::ImageFormat image_format) {
|
Shader::ImageFormat image_format) {
|
||||||
if (image_handle) {
|
if (image_handle) {
|
||||||
if (image_format == Shader::ImageFormat::Typeless) {
|
if (image_format == Shader::ImageFormat::Typeless) {
|
||||||
if (!typeless_storage_view) {
|
auto& view{typeless_storage_views[static_cast<size_t>(texture_type)]};
|
||||||
|
if (!view) {
|
||||||
auto info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
auto info = MaxwellToVK::SurfaceFormat(*device, FormatType::Optimal, true, format);
|
||||||
if (uses_widened_astc_format) {
|
if (uses_widened_astc_format) {
|
||||||
info.format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
info.format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||||
}
|
}
|
||||||
typeless_storage_view = MakeView(info.format, VK_IMAGE_ASPECT_COLOR_BIT, texture_type);
|
view = MakeView(info.format, VK_IMAGE_ASPECT_COLOR_BIT, texture_type);
|
||||||
}
|
}
|
||||||
return *typeless_storage_view;
|
return *view;
|
||||||
}
|
}
|
||||||
const bool is_signed = image_format == Shader::ImageFormat::R8_SINT
|
const bool is_signed = image_format == Shader::ImageFormat::R8_SINT
|
||||||
|| image_format == Shader::ImageFormat::R16_SINT;
|
|| image_format == Shader::ImageFormat::R16_SINT;
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,7 @@ private:
|
||||||
|
|
||||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_views;
|
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_views;
|
||||||
std::optional<StorageViews> storage_views;
|
std::optional<StorageViews> storage_views;
|
||||||
vk::ImageView typeless_storage_view;
|
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> typeless_storage_views;
|
||||||
vk::ImageView depth_view;
|
vk::ImageView depth_view;
|
||||||
vk::ImageView stencil_view;
|
vk::ImageView stencil_view;
|
||||||
vk::ImageView color_view;
|
vk::ImageView color_view;
|
||||||
|
|
|
||||||
|
|
@ -1408,6 +1408,7 @@ void TextureCache<P>::QueueAsyncDecode(Image& image, ImageId image_id) {
|
||||||
LOG_INFO(HW_GPU, "Queuing async texture decode");
|
LOG_INFO(HW_GPU, "Queuing async texture decode");
|
||||||
|
|
||||||
image.flags |= ImageFlagBits::IsDecoding;
|
image.flags |= ImageFlagBits::IsDecoding;
|
||||||
|
runtime.TransitionImageLayout(image);
|
||||||
auto decode = std::make_unique<AsyncDecodeContext>();
|
auto decode = std::make_unique<AsyncDecodeContext>();
|
||||||
auto* decode_ptr = decode.get();
|
auto* decode_ptr = decode.get();
|
||||||
decode->image_id = image_id;
|
decode->image_id = image_id;
|
||||||
|
|
@ -1440,6 +1441,7 @@ void TextureCache<P>::QueueAsyncUnswizzle(Image& image, ImageId image_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
image.flags |= ImageFlagBits::IsDecoding;
|
image.flags |= ImageFlagBits::IsDecoding;
|
||||||
|
runtime.TransitionImageLayout(image);
|
||||||
|
|
||||||
unswizzle_queue.push_back({
|
unswizzle_queue.push_back({
|
||||||
.image_id = image_id,
|
.image_id = image_id,
|
||||||
|
|
@ -1719,17 +1721,18 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
||||||
join_copies_to_do.emplace_back(JoinCopy{false, overlap_id});
|
join_copies_to_do.emplace_back(JoinCopy{false, overlap_id});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LOG_WARNING(HW_GPU,
|
if (overlap.IsSafeDownload() && False(overlap.flags & ImageFlagBits::BadOverlap) &&
|
||||||
"Dropping GPU modified overlap with no copy path: "
|
gpu_memory->GpuToCpuAddress(overlap.gpu_addr).has_value()) {
|
||||||
"overlap{{gpu_addr=0x{:x} format={} size={}x{}x{} levels={} layers={}}} "
|
QueueEvictionDownload(overlap);
|
||||||
"new{{gpu_addr=0x{:x} format={} size={}x{}x{} levels={} layers={}}}",
|
} else {
|
||||||
overlap.gpu_addr, static_cast<int>(overlap.info.format),
|
LOG_WARNING(HW_GPU,
|
||||||
overlap.info.size.width, overlap.info.size.height,
|
"Dropping GPU modified overlap, contents are not recoverable: "
|
||||||
overlap.info.size.depth, overlap.info.resources.levels,
|
"gpu_addr=0x{:x} format={} size={}x{}x{} levels={} layers={}",
|
||||||
overlap.info.resources.layers, new_image.gpu_addr,
|
overlap.gpu_addr, static_cast<int>(overlap.info.format),
|
||||||
static_cast<int>(new_info.format), new_info.size.width,
|
overlap.info.size.width, overlap.info.size.height,
|
||||||
new_info.size.height, new_info.size.depth, new_info.resources.levels,
|
overlap.info.size.depth, overlap.info.resources.levels,
|
||||||
new_info.resources.layers);
|
overlap.info.resources.layers);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (True(overlap.flags & ImageFlagBits::Tracked)) {
|
if (True(overlap.flags & ImageFlagBits::Tracked)) {
|
||||||
UntrackImage(overlap, overlap_id);
|
UntrackImage(overlap, overlap_id);
|
||||||
|
|
|
||||||
|
|
@ -747,23 +747,7 @@ boost::container::small_vector<ImageCopy, 16> MakeShrinkImageCopies(const ImageI
|
||||||
|
|
||||||
const bool is_dst_3d = dst.type == ImageType::e3D;
|
const bool is_dst_3d = dst.type == ImageType::e3D;
|
||||||
if (is_dst_3d) {
|
if (is_dst_3d) {
|
||||||
if (src.type != ImageType::e3D || src.resources.levels != 1) {
|
ASSERT(src.type == ImageType::e3D || src.resources.layers == 1);
|
||||||
LOG_CRITICAL(HW_GPU,
|
|
||||||
"Shrink copy 3D mismatch: "
|
|
||||||
"dst{{type={} format={} size={}x{}x{} levels={} layers={} "
|
|
||||||
"block_depth={} samples={}}} "
|
|
||||||
"src{{type={} format={} size={}x{}x{} levels={} layers={} "
|
|
||||||
"block_depth={} samples={}}} "
|
|
||||||
"base{{level={} layer={}}}",
|
|
||||||
static_cast<int>(dst.type), static_cast<int>(dst.format), dst.size.width,
|
|
||||||
dst.size.height, dst.size.depth, dst.resources.levels,
|
|
||||||
dst.resources.layers, dst.block.depth, dst.num_samples,
|
|
||||||
static_cast<int>(src.type), static_cast<int>(src.format), src.size.width,
|
|
||||||
src.size.height, src.size.depth, src.resources.levels,
|
|
||||||
src.resources.layers, src.block.depth, src.num_samples, base.level,
|
|
||||||
base.layer);
|
|
||||||
}
|
|
||||||
ASSERT(src.type == ImageType::e3D);
|
|
||||||
ASSERT(src.resources.levels == 1);
|
ASSERT(src.resources.levels == 1);
|
||||||
}
|
}
|
||||||
const bool both_2d{src.type == ImageType::e2D && dst.type == ImageType::e2D};
|
const bool both_2d{src.type == ImageType::e2D && dst.type == ImageType::e2D};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue