video_core: Make use of ordered container contains() where applicable

With C++20, we can use the more concise contains() member function
instead of comparing the result of the find() call with the end
iterator.
This commit is contained in:
Lioncash 2020-12-07 16:30:36 -05:00
parent 5cd051eced
commit 09fa1d6a73
8 changed files with 13 additions and 16 deletions

View file

@ -230,7 +230,7 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa
if (!attribute.enabled) {
continue;
}
if (input_attributes.find(static_cast<u32>(index)) == input_attributes.end()) {
if (!input_attributes.contains(static_cast<u32>(index))) {
// Skip attributes not used by the vertex shaders.
continue;
}

View file

@ -2125,8 +2125,7 @@ private:
OpStore(z_pointer, depth);
}
if (stage == ShaderType::Fragment) {
const auto SafeGetRegister = [&](u32 reg) {
// TODO(Rodrigo): Replace with contains once C++20 releases
const auto SafeGetRegister = [this](u32 reg) {
if (const auto it = registers.find(reg); it != registers.end()) {
return OpLoad(t_float, it->second);
}