mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-01 04:24:21 +00:00
[TEST] Quick corrections
This commit is contained in:
@@ -368,8 +368,11 @@ bool IsDepthClipEnabled(const Maxwell& regs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsDepthClampEnabled(const Maxwell& regs, bool has_depth_clip_enable) {
|
bool IsDepthClampEnabled(const Maxwell& regs, bool has_depth_clip_enable) {
|
||||||
|
if (!IsDepthClipEnabled(regs)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (!has_depth_clip_enable) {
|
if (!has_depth_clip_enable) {
|
||||||
return !IsDepthClipEnabled(regs);
|
return false;
|
||||||
}
|
}
|
||||||
return regs.viewport_clip_control.pixel_min_z.Value() != 0 ||
|
return regs.viewport_clip_control.pixel_min_z.Value() != 0 ||
|
||||||
regs.viewport_clip_control.pixel_max_z.Value() != 0;
|
regs.viewport_clip_control.pixel_max_z.Value() != 0;
|
||||||
|
|||||||
@@ -895,6 +895,15 @@ void BlitScale(Scheduler& scheduler, VkImage src_image, VkImage dst_image, const
|
|||||||
0, nullptr, nullptr, write_barriers);
|
0, nullptr, nullptr, write_barriers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] bool CanBlitNatively(const Device& device, PixelFormat format) {
|
||||||
|
static constexpr auto OPTIMAL_FORMAT = FormatType::Optimal;
|
||||||
|
static constexpr VkFormatFeatureFlags BLIT_USAGE =
|
||||||
|
VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_DST_BIT;
|
||||||
|
const VkFormat vk_format =
|
||||||
|
MaxwellToVK::SurfaceFormat(device, OPTIMAL_FORMAT, false, format).format;
|
||||||
|
return device.IsFormatSupported(vk_format, BLIT_USAGE, OPTIMAL_FORMAT);
|
||||||
|
}
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& scheduler_,
|
TextureCacheRuntime::TextureCacheRuntime(const Device& device_, Scheduler& scheduler_,
|
||||||
@@ -1227,27 +1236,19 @@ void TextureCacheRuntime::BlitImage(Framebuffer* dst_framebuffer, ImageView& dst
|
|||||||
blit_image_helper.ResolveDepthStencil(dst_framebuffer, src, dst_region, src_region);
|
blit_image_helper.ResolveDepthStencil(dst_framebuffer, src, dst_region, src_region);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (aspect_mask == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
|
static constexpr VkImageAspectFlags DEPTH_STENCIL_ASPECTS =
|
||||||
const auto format = src.format;
|
VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||||
const auto can_blit_depth_stencil = [this, format] {
|
if ((aspect_mask & DEPTH_STENCIL_ASPECTS) != 0 && !CanBlitNatively(device, src.format)) {
|
||||||
switch (format) {
|
if (aspect_mask != DEPTH_STENCIL_ASPECTS) {
|
||||||
case VideoCore::Surface::PixelFormat::D24_UNORM_S8_UINT:
|
UNIMPLEMENTED_MSG("Host cannot blit format {} and no helper path exists for aspect "
|
||||||
case VideoCore::Surface::PixelFormat::S8_UINT_D24_UNORM:
|
"mask 0x{:x}",
|
||||||
return device.IsBlitDepth24Stencil8Supported();
|
src.format, aspect_mask);
|
||||||
case VideoCore::Surface::PixelFormat::D32_FLOAT_S8_UINT:
|
|
||||||
return device.IsBlitDepth32Stencil8Supported();
|
|
||||||
default:
|
|
||||||
UNREACHABLE();
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
// Use shader-based depth/stencil blits if hardware doesn't support the format
|
|
||||||
// Note: MSAA resolves (MSAA->single) use vkCmdResolveImage which works fine
|
|
||||||
if (!can_blit_depth_stencil) {
|
|
||||||
UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa);
|
|
||||||
blit_image_helper.BlitDepthStencil(dst_framebuffer, src, dst_region, src_region,
|
|
||||||
filter, operation);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
UNIMPLEMENTED_IF(is_src_msaa || is_dst_msaa);
|
||||||
|
blit_image_helper.BlitDepthStencil(dst_framebuffer, src, dst_region, src_region, filter,
|
||||||
|
operation);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
ASSERT(!(is_dst_msaa && !is_src_msaa));
|
ASSERT(!(is_dst_msaa && !is_src_msaa));
|
||||||
ASSERT(operation == Fermi2D::Operation::SrcCopy);
|
ASSERT(operation == Fermi2D::Operation::SrcCopy);
|
||||||
|
|||||||
Reference in New Issue
Block a user