mirror of
https://github.com/PabloMK7/citra.git
synced 2024-11-15 19:43:27 +01:00
rasterizer_cache: Make reinterpretation stricter (#6515)
This commit is contained in:
parent
2035433159
commit
f9ab0b3042
@ -1131,12 +1131,10 @@ void RasterizerCache<T>::DownloadFillSurface(Surface& surface, SurfaceInterval i
|
||||
template <class T>
|
||||
bool RasterizerCache<T>::ValidateByReinterpretation(Surface& surface, SurfaceParams params,
|
||||
const SurfaceInterval& interval) {
|
||||
const bool is_gpu_modified = boost::icl::contains(dirty_regions, interval);
|
||||
SurfaceId reinterpret_id =
|
||||
FindMatch<MatchFlags::Reinterpret>(params, ScaleMatch::Ignore, interval);
|
||||
if (reinterpret_id) {
|
||||
Surface& src_surface = slot_surfaces[reinterpret_id];
|
||||
if (src_surface.stride == surface.stride) {
|
||||
const SurfaceInterval copy_interval = src_surface.GetCopyableInterval(params);
|
||||
if (boost::icl::is_empty(copy_interval)) {
|
||||
return false;
|
||||
@ -1151,18 +1149,12 @@ bool RasterizerCache<T>::ValidateByReinterpretation(Surface& surface, SurfacePar
|
||||
};
|
||||
return runtime.Reinterpret(src_surface, surface, reinterpret);
|
||||
}
|
||||
LOG_INFO(HW_GPU, "Unimplemented dimentional reinterpretatation {}x{} -> {}x{}",
|
||||
src_surface.width, src_surface.height, surface.width, surface.height);
|
||||
// A surface with matching bit width was found but couldn't be reinterpreted
|
||||
// due to mismatching stride. It's probably a developer mistake so skip flushing
|
||||
// if it was created on the GPU.
|
||||
return is_gpu_modified;
|
||||
}
|
||||
|
||||
// No surfaces were found in the cache that had a matching bit-width.
|
||||
// If there's a surface with invalid format it means the region was cleared
|
||||
// so we don't want to skip validation in that case.
|
||||
const bool has_invalid = IntervalHasInvalidPixelFormat(params, interval);
|
||||
const bool is_gpu_modified = boost::icl::contains(dirty_regions, interval);
|
||||
return !has_invalid && is_gpu_modified;
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,9 @@ bool SurfaceParams::CanSubRect(const SurfaceParams& sub_surface) const {
|
||||
bool SurfaceParams::CanReinterpret(const SurfaceParams& other_surface) {
|
||||
return other_surface.addr >= addr && other_surface.end <= end &&
|
||||
pixel_format != PixelFormat::Invalid && GetFormatBpp() == other_surface.GetFormatBpp() &&
|
||||
other_surface.is_tiled == is_tiled &&
|
||||
(other_surface.addr - addr) % BytesInPixels(is_tiled ? 64 : 1) == 0;
|
||||
other_surface.is_tiled == is_tiled && other_surface.stride == stride &&
|
||||
(other_surface.addr - addr) % BytesInPixels(is_tiled ? 64 : 1) == 0 &&
|
||||
GetSubRect(other_surface).right <= stride;
|
||||
}
|
||||
|
||||
bool SurfaceParams::CanExpand(const SurfaceParams& expanded_surface) const {
|
||||
|
Loading…
Reference in New Issue
Block a user