summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Lioncash2019-01-29 14:48:31 -0500
committerGravatar Lioncash2019-01-29 21:13:33 -0500
commitf45c25aabacc70861723a7ca1096a677bd987487 (patch)
treeb3e19530caf4c1f1f6c6e3f2c0697051f50a55d1 /src/core
parenthle/ipc_helpers: Fix clang-format warnings (diff)
downloadyuzu-f45c25aabacc70861723a7ca1096a677bd987487.tar.gz
yuzu-f45c25aabacc70861723a7ca1096a677bd987487.tar.xz
yuzu-f45c25aabacc70861723a7ca1096a677bd987487.zip
nvflinger: Use a std::array for the available displays instead of std::vector
The built-in set of displays is fixed, so we can utilize an array instead of a vector here.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.cpp6
-rw-r--r--src/core/hle/service/nvflinger/nvflinger.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index 6a613aeab..5bc0d74e8 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -30,12 +30,6 @@ constexpr std::size_t SCREEN_REFRESH_RATE = 60;
30constexpr u64 frame_ticks = static_cast<u64>(CoreTiming::BASE_CLOCK_RATE / SCREEN_REFRESH_RATE); 30constexpr u64 frame_ticks = static_cast<u64>(CoreTiming::BASE_CLOCK_RATE / SCREEN_REFRESH_RATE);
31 31
32NVFlinger::NVFlinger() { 32NVFlinger::NVFlinger() {
33 // Add the different displays to the list of displays.
34 displays.emplace_back(0, "Default");
35 displays.emplace_back(1, "External");
36 displays.emplace_back(2, "Edid");
37 displays.emplace_back(3, "Internal");
38
39 // Schedule the screen composition events 33 // Schedule the screen composition events
40 composition_event = 34 composition_event =
41 CoreTiming::RegisterEvent("ScreenComposition", [this](u64 userdata, int cycles_late) { 35 CoreTiming::RegisterEvent("ScreenComposition", [this](u64 userdata, int cycles_late) {
diff --git a/src/core/hle/service/nvflinger/nvflinger.h b/src/core/hle/service/nvflinger/nvflinger.h
index 9abba555b..5ba64a4ce 100644
--- a/src/core/hle/service/nvflinger/nvflinger.h
+++ b/src/core/hle/service/nvflinger/nvflinger.h
@@ -4,6 +4,7 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <array>
7#include <memory> 8#include <memory>
8#include <string> 9#include <string>
9#include <string_view> 10#include <string_view>
@@ -84,7 +85,12 @@ private:
84 85
85 std::shared_ptr<Nvidia::Module> nvdrv; 86 std::shared_ptr<Nvidia::Module> nvdrv;
86 87
87 std::vector<Display> displays; 88 std::array<Display, 4> displays{{
89 {0, "Default"},
90 {1, "External"},
91 {2, "Edid"},
92 {3, "Internal"},
93 }};
88 std::vector<std::shared_ptr<BufferQueue>> buffer_queues; 94 std::vector<std::shared_ptr<BufferQueue>> buffer_queues;
89 95
90 /// Id to use for the next layer that is created, this counter is shared among all displays. 96 /// Id to use for the next layer that is created, this counter is shared among all displays.