code: Remove usages of std::ranges

* MacOS is still runining my C++ 20 fun
This commit is contained in:
emufan4568
2022-10-19 20:39:33 +03:00
committed by GPUCode
parent f75380fc93
commit 01e2b6cdaa
3 changed files with 5 additions and 5 deletions

View File

@ -496,7 +496,7 @@ MemoryRef MemorySystem::GetPhysicalRef(PAddr address) const {
std::make_pair(N3DS_EXTRA_RAM_PADDR, N3DS_EXTRA_RAM_SIZE),
};
const auto area = std::ranges::find_if(memory_areas, [&](const auto& area) {
const auto area = std::find_if(memory_areas.begin(), memory_areas.end(), [&](const auto& area) {
// Note: the region end check is inclusive because the user can pass in an address that
// represents an open right bound
return address >= area.first && address <= area.first + area.second;

View File

@ -113,7 +113,7 @@ std::vector<const char*> GetInstanceExtensions(Frontend::WindowSystemType window
}
for (const char* extension : extensions) {
const auto iter = std::ranges::find_if(properties, [extension](const auto& prop) {
const auto iter = std::find_if(properties.begin(), properties.end(), [extension](const auto& prop) {
return std::strcmp(extension, prop.extensionName) == 0;
});

View File

@ -81,8 +81,8 @@ void Swapchain::Create(u32 width, u32 height) {
swapchain_images.clear();
swapchain_images.resize(images.size());
std::ranges::transform(
images, swapchain_images.begin(), [device, this](vk::Image image) -> Image {
std::transform(
images.begin(), images.end(), swapchain_images.begin(), [device, this](vk::Image image) -> Image {
const vk::ImageViewCreateInfo view_info = {
.image = image,
.viewType = vk::ImageViewType::e2D,
@ -172,7 +172,7 @@ void Swapchain::Configure(u32 width, u32 height) {
if (formats.size() == 1 && formats[0].format == vk::Format::eUndefined) {
surface_format.format = vk::Format::eB8G8R8A8Unorm;
} else {
auto it = std::ranges::find_if(formats, [](vk::SurfaceFormatKHR format) -> bool {
auto it = std::find_if(formats.begin(), formats.end(), [](vk::SurfaceFormatKHR format) -> bool {
return format.colorSpace == vk::ColorSpaceKHR::eSrgbNonlinear &&
format.format == vk::Format::eB8G8R8A8Unorm;
});