Browse Source

[TEST] Corroborating the dowload/copy on MSAA path

android-meows
CamilleLaVey 3 days ago
parent
commit
2e52ca5753
  1. 9
      src/video_core/texture_cache/image_base.cpp
  2. 2
      src/video_core/texture_cache/image_base.h
  3. 2
      src/video_core/texture_cache/texture_cache.h

9
src/video_core/texture_cache/image_base.cpp

@ -121,7 +121,7 @@ void ImageBase::InsertView(const ImageViewInfo& view_info, ImageViewId image_vie
image_view_ids.push_back(image_view_id); image_view_ids.push_back(image_view_id);
} }
bool ImageBase::IsSafeDownload() const noexcept {
bool ImageBase::IsSafeGpuCopy() const noexcept {
// Skip images that were not modified from the GPU // Skip images that were not modified from the GPU
if (False(flags & ImageFlagBits::GpuModified)) { if (False(flags & ImageFlagBits::GpuModified)) {
return false; return false;
@ -131,6 +131,13 @@ bool ImageBase::IsSafeDownload() const noexcept {
if (True(flags & ImageFlagBits::CpuModified)) { if (True(flags & ImageFlagBits::CpuModified)) {
return false; return false;
} }
return true;
}
bool ImageBase::IsSafeDownload() const noexcept {
if (!IsSafeGpuCopy()) {
return false;
}
if (info.num_samples > 1) { if (info.num_samples > 1) {
LOG_WARNING(HW_GPU, "MSAA image downloads are not implemented"); LOG_WARNING(HW_GPU, "MSAA image downloads are not implemented");
return false; return false;

2
src/video_core/texture_cache/image_base.h

@ -64,6 +64,8 @@ struct ImageBase {
void InsertView(const ImageViewInfo& view_info, ImageViewId image_view_id); void InsertView(const ImageViewInfo& view_info, ImageViewId image_view_id);
[[nodiscard]] bool IsSafeGpuCopy() const noexcept;
[[nodiscard]] bool IsSafeDownload() const noexcept; [[nodiscard]] bool IsSafeDownload() const noexcept;
[[nodiscard]] bool Overlaps(VAddr overlap_cpu_addr, size_t overlap_size) const noexcept { [[nodiscard]] bool Overlaps(VAddr overlap_cpu_addr, size_t overlap_size) const noexcept {

2
src/video_core/texture_cache/texture_cache.h

@ -1691,7 +1691,7 @@ ImageId TextureCache<P>::JoinImages(const ImageInfo& info, GPUVAddr gpu_addr, DA
for (const auto& copy_object : join_copies_to_do) { for (const auto& copy_object : join_copies_to_do) {
Image& overlap = slot_images[copy_object.id]; Image& overlap = slot_images[copy_object.id];
if (copy_object.is_alias) { if (copy_object.is_alias) {
if (!overlap.IsSafeDownload()) {
if (!overlap.IsSafeGpuCopy()) {
continue; continue;
} }
const auto alias_pointer = join_alias_indices.find(copy_object.id); const auto alias_pointer = join_alias_indices.find(copy_object.id);

Loading…
Cancel
Save