mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-15 21:19:47 +00:00
some debugs tools
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@@ -103,8 +104,20 @@ VkViewport GetViewportState(const Device& device, const Maxwell& regs, size_t in
|
||||
.maxDepth = src.translate_z + src.scale_z,
|
||||
};
|
||||
if (!device.IsExtDepthRangeUnrestrictedSupported()) {
|
||||
const float unclamped_min = viewport.minDepth;
|
||||
const float unclamped_max = viewport.maxDepth;
|
||||
viewport.minDepth = std::clamp(viewport.minDepth, 0.0f, 1.0f);
|
||||
viewport.maxDepth = std::clamp(viewport.maxDepth, 0.0f, 1.0f);
|
||||
if (viewport.minDepth != unclamped_min || viewport.maxDepth != unclamped_max) {
|
||||
static std::atomic<u32> reported{0};
|
||||
if (reported.fetch_add(1, std::memory_order_relaxed) < 32) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Depth range clamped: viewport={} mode={} translate_z={} scale_z={} "
|
||||
"range=[{}, {}] -> [{}, {}]",
|
||||
index, static_cast<u32>(regs.depth_mode), src.translate_z, src.scale_z,
|
||||
unclamped_min, unclamped_max, viewport.minDepth, viewport.maxDepth);
|
||||
}
|
||||
}
|
||||
}
|
||||
return viewport;
|
||||
}
|
||||
|
||||
@@ -1791,6 +1791,8 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
||||
ImageBase& aliased = slot_images[aliased_id];
|
||||
aliased.overlapping_images.push_back(new_image_id);
|
||||
new_image.overlapping_images.push_back(aliased_id);
|
||||
const bool aliased_was_bad = True(aliased.flags & ImageFlagBits::BadOverlap);
|
||||
const bool new_was_bad = True(new_image.flags & ImageFlagBits::BadOverlap);
|
||||
if (aliased.info.resources.levels == 1 && aliased.info.block.depth == 0 &&
|
||||
aliased.overlapping_images.size() > 1) {
|
||||
aliased.flags |= ImageFlagBits::BadOverlap;
|
||||
@@ -1799,6 +1801,21 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
|
||||
new_image.overlapping_images.size() > 1) {
|
||||
new_image.flags |= ImageFlagBits::BadOverlap;
|
||||
}
|
||||
const bool aliased_is_bad = True(aliased.flags & ImageFlagBits::BadOverlap);
|
||||
const bool new_is_bad = True(new_image.flags & ImageFlagBits::BadOverlap);
|
||||
if ((!aliased_was_bad && aliased_is_bad) || (!new_was_bad && new_is_bad)) {
|
||||
LOG_WARNING(HW_GPU,
|
||||
"Bad overlap: existing gpu_addr={:#x} {}x{}x{} fmt={} type={} rt={} | "
|
||||
"incoming gpu_addr={:#x} {}x{}x{} fmt={} type={} rt={}",
|
||||
aliased.gpu_addr, aliased.info.size.width, aliased.info.size.height,
|
||||
aliased.info.size.depth, static_cast<u32>(aliased.info.format),
|
||||
static_cast<u32>(aliased.info.type),
|
||||
True(aliased.flags & ImageFlagBits::GpuModified),
|
||||
new_image.gpu_addr, new_image.info.size.width, new_image.info.size.height,
|
||||
new_image.info.size.depth, static_cast<u32>(new_image.info.format),
|
||||
static_cast<u32>(new_image.info.type),
|
||||
True(new_image.flags & ImageFlagBits::GpuModified));
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& copy_object : join_copies_to_do) {
|
||||
|
||||
Reference in New Issue
Block a user