mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-20 06:53:11 +00:00
[TEST] Miscellaneous changes
This commit is contained in:
@@ -1992,10 +1992,10 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset,
|
||||
image_copies.push_back(image_copy);
|
||||
}
|
||||
|
||||
runtime->TransitionImageLayout(*this);
|
||||
runtime->blit_image_helper.CopyMSAA(runtime->render_pass_cache, Handle(), info.format,
|
||||
temp_vk_image, info.format, info.num_samples,
|
||||
image_copies, false);
|
||||
initialized = true;
|
||||
runtime->pending_msaa_images.emplace_back(scheduler->CurrentTick(), std::move(temp_image));
|
||||
|
||||
if (is_rescaled) {
|
||||
@@ -2006,6 +2006,9 @@ void Image::UploadMemory(VkBuffer buffer, VkDeviceSize offset,
|
||||
|
||||
if (info.num_samples > 1) {
|
||||
LOG_WARNING(Render_Vulkan, "MSAA upload not implemented for format {}", info.format);
|
||||
if (runtime != nullptr) {
|
||||
runtime->TransitionImageLayout(*this);
|
||||
}
|
||||
if (is_rescaled) {
|
||||
ScaleUp();
|
||||
}
|
||||
@@ -2588,14 +2591,15 @@ VkImageView ImageView::StorageView(Shader::TextureType texture_type,
|
||||
Shader::ImageFormat image_format) {
|
||||
if (image_handle) {
|
||||
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);
|
||||
if (uses_widened_astc_format) {
|
||||
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
|
||||
|| image_format == Shader::ImageFormat::R16_SINT;
|
||||
|
||||
@@ -487,7 +487,7 @@ private:
|
||||
|
||||
std::array<vk::ImageView, Shader::NUM_TEXTURE_TYPES> image_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 stencil_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");
|
||||
|
||||
image.flags |= ImageFlagBits::IsDecoding;
|
||||
runtime.TransitionImageLayout(image);
|
||||
auto decode = std::make_unique<AsyncDecodeContext>();
|
||||
auto* decode_ptr = decode.get();
|
||||
decode->image_id = image_id;
|
||||
@@ -1440,6 +1441,7 @@ void TextureCache<P>::QueueAsyncUnswizzle(Image& image, ImageId image_id) {
|
||||
}
|
||||
|
||||
image.flags |= ImageFlagBits::IsDecoding;
|
||||
runtime.TransitionImageLayout(image);
|
||||
|
||||
unswizzle_queue.push_back({
|
||||
.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});
|
||||
continue;
|
||||
}
|
||||
LOG_WARNING(HW_GPU,
|
||||
"Dropping GPU modified overlap with no copy path: "
|
||||
"overlap{{gpu_addr=0x{:x} format={} size={}x{}x{} levels={} layers={}}} "
|
||||
"new{{gpu_addr=0x{:x} format={} size={}x{}x{} levels={} layers={}}}",
|
||||
overlap.gpu_addr, static_cast<int>(overlap.info.format),
|
||||
overlap.info.size.width, overlap.info.size.height,
|
||||
overlap.info.size.depth, overlap.info.resources.levels,
|
||||
overlap.info.resources.layers, new_image.gpu_addr,
|
||||
static_cast<int>(new_info.format), new_info.size.width,
|
||||
new_info.size.height, new_info.size.depth, new_info.resources.levels,
|
||||
new_info.resources.layers);
|
||||
if (overlap.IsSafeDownload() && False(overlap.flags & ImageFlagBits::BadOverlap) &&
|
||||
gpu_memory->GpuToCpuAddress(overlap.gpu_addr).has_value()) {
|
||||
QueueEvictionDownload(overlap);
|
||||
} else {
|
||||
LOG_WARNING(HW_GPU,
|
||||
"Dropping GPU modified overlap, contents are not recoverable: "
|
||||
"gpu_addr=0x{:x} format={} size={}x{}x{} levels={} layers={}",
|
||||
overlap.gpu_addr, static_cast<int>(overlap.info.format),
|
||||
overlap.info.size.width, overlap.info.size.height,
|
||||
overlap.info.size.depth, overlap.info.resources.levels,
|
||||
overlap.info.resources.layers);
|
||||
}
|
||||
}
|
||||
if (True(overlap.flags & ImageFlagBits::Tracked)) {
|
||||
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;
|
||||
if (is_dst_3d) {
|
||||
if (src.type != ImageType::e3D || src.resources.levels != 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.type == ImageType::e3D || src.resources.layers == 1);
|
||||
ASSERT(src.resources.levels == 1);
|
||||
}
|
||||
const bool both_2d{src.type == ImageType::e2D && dst.type == ImageType::e2D};
|
||||
|
||||
Reference in New Issue
Block a user