diff options
| author | 2023-10-17 11:48:57 -0400 | |
|---|---|---|
| committer | 2023-10-17 11:48:57 -0400 | |
| commit | fa56518f209ad17ca0a46c408cc752d4083137ea (patch) | |
| tree | 0d33133e57675a5bfb2cee830b03aa7cd8effea2 /src/video_core/texture_cache | |
| parent | Merge pull request #11349 from vonchenplus/buffer_cache_crash (diff) | |
| parent | Get out of render pass before query barriers, fix image names with samples > ... (diff) | |
| download | yuzu-fa56518f209ad17ca0a46c408cc752d4083137ea.tar.gz yuzu-fa56518f209ad17ca0a46c408cc752d4083137ea.tar.xz yuzu-fa56518f209ad17ca0a46c408cc752d4083137ea.zip | |
Merge pull request #11747 from Kelebek1/image_alias_sample_names
Small things
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/formatter.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/texture_cache/samples_helper.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/video_core/texture_cache/formatter.cpp b/src/video_core/texture_cache/formatter.cpp index 6279d8e9e..2b7e0df72 100644 --- a/src/video_core/texture_cache/formatter.cpp +++ b/src/video_core/texture_cache/formatter.cpp | |||
| @@ -10,19 +10,23 @@ | |||
| 10 | #include "video_core/texture_cache/image_info.h" | 10 | #include "video_core/texture_cache/image_info.h" |
| 11 | #include "video_core/texture_cache/image_view_base.h" | 11 | #include "video_core/texture_cache/image_view_base.h" |
| 12 | #include "video_core/texture_cache/render_targets.h" | 12 | #include "video_core/texture_cache/render_targets.h" |
| 13 | #include "video_core/texture_cache/samples_helper.h" | ||
| 13 | 14 | ||
| 14 | namespace VideoCommon { | 15 | namespace VideoCommon { |
| 15 | 16 | ||
| 16 | std::string Name(const ImageBase& image) { | 17 | std::string Name(const ImageBase& image) { |
| 17 | const GPUVAddr gpu_addr = image.gpu_addr; | 18 | const GPUVAddr gpu_addr = image.gpu_addr; |
| 18 | const ImageInfo& info = image.info; | 19 | const ImageInfo& info = image.info; |
| 19 | const u32 width = info.size.width; | 20 | u32 width = info.size.width; |
| 20 | const u32 height = info.size.height; | 21 | u32 height = info.size.height; |
| 21 | const u32 depth = info.size.depth; | 22 | const u32 depth = info.size.depth; |
| 22 | const u32 num_layers = image.info.resources.layers; | 23 | const u32 num_layers = image.info.resources.layers; |
| 23 | const u32 num_levels = image.info.resources.levels; | 24 | const u32 num_levels = image.info.resources.levels; |
| 24 | std::string resource; | 25 | std::string resource; |
| 25 | if (image.info.num_samples > 1) { | 26 | if (image.info.num_samples > 1) { |
| 27 | const auto [samples_x, samples_y] = VideoCommon::SamplesLog2(image.info.num_samples); | ||
| 28 | width >>= samples_x; | ||
| 29 | height >>= samples_y; | ||
| 26 | resource += fmt::format(":{}xMSAA", image.info.num_samples); | 30 | resource += fmt::format(":{}xMSAA", image.info.num_samples); |
| 27 | } | 31 | } |
| 28 | if (num_layers > 1) { | 32 | if (num_layers > 1) { |
diff --git a/src/video_core/texture_cache/samples_helper.h b/src/video_core/texture_cache/samples_helper.h index 203ac1b11..2ee2f8312 100644 --- a/src/video_core/texture_cache/samples_helper.h +++ b/src/video_core/texture_cache/samples_helper.h | |||
| @@ -24,7 +24,7 @@ namespace VideoCommon { | |||
| 24 | return {2, 2}; | 24 | return {2, 2}; |
| 25 | } | 25 | } |
| 26 | ASSERT_MSG(false, "Invalid number of samples={}", num_samples); | 26 | ASSERT_MSG(false, "Invalid number of samples={}", num_samples); |
| 27 | return {1, 1}; | 27 | return {0, 0}; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | [[nodiscard]] inline int NumSamples(Tegra::Texture::MsaaMode msaa_mode) { | 30 | [[nodiscard]] inline int NumSamples(Tegra::Texture::MsaaMode msaa_mode) { |