diff options
| author | lizzie <lizzie@eden-emu.dev> | 2025-09-09 20:47:49 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2025-09-09 20:47:49 +0200 |
| commit | 9d2681ecc9565681db623fb71799e76381998512 (patch) | |
| tree | 3133129860a1569a8be8e7e0c9c5985adbd992ca /src/video_core/texture_cache/texture_cache.h | |
| parent | 428f136a754096e34c7bfec902684e2546a43ca4 (diff) | |
[cmake] enable clang-cl and WoA builds (#348)
Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64.
Compiling on clang is *dramatically* faster so this should be useful for CI.
Co-authored-by: crueter <crueter@eden-emu.dev>
Co-authored-by: crueter <crueter@crueter.xyz>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/348
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 6c733fe902..e5d559b591 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -56,14 +56,14 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag const s64 device_local_memory = static_cast<s64>(runtime.GetDeviceLocalMemory()); const s64 min_spacing_expected = device_local_memory - 1_GiB; const s64 min_spacing_critical = device_local_memory - 512_MiB; - const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); + const s64 mem_threshold = (std::min)(device_local_memory, TARGET_THRESHOLD); const s64 min_vacancy_expected = (6 * mem_threshold) / 10; const s64 min_vacancy_critical = (2 * mem_threshold) / 10; expected_memory = static_cast<u64>( - std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), + (std::max)((std::min)(device_local_memory - min_vacancy_expected, min_spacing_expected), DEFAULT_EXPECTED_MEMORY)); critical_memory = static_cast<u64>( - std::max(std::min(device_local_memory - min_vacancy_critical, min_spacing_critical), + (std::max)((std::min)(device_local_memory - min_vacancy_critical, min_spacing_critical), DEFAULT_CRITICAL_MEMORY)); minimum_memory = static_cast<u64>((device_local_memory - mem_threshold) / 2); } else { @@ -586,8 +586,8 @@ std::optional<VideoCore::RasterizerDownloadArea> TextureCache<P>::GetFlushArea(D area->end_address = cpu_addr + size; area->preemtive = true; } - area->start_address = std::min(area->start_address, image.cpu_addr); - area->end_address = std::max(area->end_address, image.cpu_addr_end); + area->start_address = (std::min)(area->start_address, image.cpu_addr); + area->end_address = (std::max)(area->end_address, image.cpu_addr_end); for (auto image_view_id : image.image_view_ids) { auto& image_view = slot_image_views[image_view_id]; image_view.flags |= ImageViewFlagBits::PreemtiveDownload; @@ -1273,7 +1273,7 @@ u64 TextureCache<P>::GetScaledImageSizeBytes(const ImageBase& image) { const u64 down_shift = static_cast<u64>(Settings::values.resolution_info.down_shift + Settings::values.resolution_info.down_shift); const u64 image_size_bytes = - static_cast<u64>(std::max(image.guest_size_bytes, image.unswizzled_size_bytes)); + static_cast<u64>((std::max)(image.guest_size_bytes, image.unswizzled_size_bytes)); const u64 tentative_size = (image_size_bytes * scale_up) >> down_shift; const u64 fitted_size = Common::AlignUp(tentative_size, 1024); return fitted_size; @@ -1994,7 +1994,7 @@ void TextureCache<P>::RegisterImage(ImageId image_id) { ASSERT_MSG(False(image.flags & ImageFlagBits::Registered), "Trying to register an already registered image"); image.flags |= ImageFlagBits::Registered; - u64 tentative_size = std::max(image.guest_size_bytes, image.unswizzled_size_bytes); + u64 tentative_size = (std::max)(image.guest_size_bytes, image.unswizzled_size_bytes); if ((IsPixelFormatASTC(image.info.format) && True(image.flags & ImageFlagBits::AcceleratedUpload)) || True(image.flags & ImageFlagBits::Converted)) { @@ -2168,7 +2168,7 @@ void TextureCache<P>::DeleteImage(ImageId image_id, bool immediate_delete) { if (image.HasScaled()) { total_used_memory -= GetScaledImageSizeBytes(image); } - u64 tentative_size = std::max(image.guest_size_bytes, image.unswizzled_size_bytes); + u64 tentative_size = (std::max)(image.guest_size_bytes, image.unswizzled_size_bytes); if ((IsPixelFormatASTC(image.info.format) && True(image.flags & ImageFlagBits::AcceleratedUpload)) || True(image.flags & ImageFlagBits::Converted)) { @@ -2302,7 +2302,7 @@ void TextureCache<P>::SynchronizeAliases(ImageId image_id) { for (const AliasedImage& aliased : image.aliased_images) { ImageBase& aliased_image = slot_images[aliased.id]; if (image.modification_tick < aliased_image.modification_tick) { - most_recent_tick = std::max(most_recent_tick, aliased_image.modification_tick); + most_recent_tick = (std::max)(most_recent_tick, aliased_image.modification_tick); aliased_images.push_back(&aliased); any_rescaled |= True(aliased_image.flags & ImageFlagBits::Rescaled); any_modified |= True(aliased_image.flags & ImageFlagBits::GpuModified); @@ -2443,9 +2443,9 @@ void TextureCache<P>::CopyImage(ImageId dst_id, ImageId src_id, std::vector<Imag ImageView& dst_view = slot_image_views[dst_view_id]; ImageView& src_view = slot_image_views[src_view_id]; [[maybe_unused]] const Extent3D expected_size{ - .width = std::min(dst_view.size.width, src_view.size.width), - .height = std::min(dst_view.size.height, src_view.size.height), - .depth = std::min(dst_view.size.depth, src_view.size.depth), + .width = (std::min)(dst_view.size.width, src_view.size.width), + .height = (std::min)(dst_view.size.height, src_view.size.height), + .depth = (std::min)(dst_view.size.depth, src_view.size.depth), }; const Extent3D scaled_extent = [is_rescaled, expected_size]() { if (!is_rescaled) { |
