summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp53
-rw-r--r--src/core/hle/kernel/address_arbiter.h2
-rw-r--r--src/core/hle/kernel/thread.cpp4
-rw-r--r--src/core/hle/service/bcat/backend/backend.cpp4
-rw-r--r--src/video_core/engines/maxwell_3d.h7
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp1
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp1
-rw-r--r--src/video_core/renderer_opengl/gl_state.h1
8 files changed, 39 insertions, 34 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 2ea3dcb61..8475b698c 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -201,42 +201,39 @@ void AddressArbiter::HandleWakeupThread(std::shared_ptr<Thread> thread) {
201void AddressArbiter::InsertThread(std::shared_ptr<Thread> thread) { 201void AddressArbiter::InsertThread(std::shared_ptr<Thread> thread) {
202 const VAddr arb_addr = thread->GetArbiterWaitAddress(); 202 const VAddr arb_addr = thread->GetArbiterWaitAddress();
203 std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[arb_addr]; 203 std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[arb_addr];
204 auto it = thread_list.begin(); 204
205 while (it != thread_list.end()) { 205 const auto iter =
206 const std::shared_ptr<Thread>& current_thread = *it; 206 std::find_if(thread_list.cbegin(), thread_list.cend(), [&thread](const auto& entry) {
207 if (current_thread->GetPriority() >= thread->GetPriority()) { 207 return entry->GetPriority() >= thread->GetPriority();
208 thread_list.insert(it, thread); 208 });
209 return; 209
210 } 210 if (iter == thread_list.cend()) {
211 ++it; 211 thread_list.push_back(std::move(thread));
212 } else {
213 thread_list.insert(iter, std::move(thread));
212 } 214 }
213 thread_list.push_back(std::move(thread));
214} 215}
215 216
216void AddressArbiter::RemoveThread(std::shared_ptr<Thread> thread) { 217void AddressArbiter::RemoveThread(std::shared_ptr<Thread> thread) {
217 const VAddr arb_addr = thread->GetArbiterWaitAddress(); 218 const VAddr arb_addr = thread->GetArbiterWaitAddress();
218 std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[arb_addr]; 219 std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[arb_addr];
219 auto it = thread_list.begin(); 220
220 while (it != thread_list.end()) { 221 const auto iter = std::find_if(thread_list.cbegin(), thread_list.cend(),
221 const std::shared_ptr<Thread>& current_thread = *it; 222 [&thread](const auto& entry) { return thread == entry; });
222 if (current_thread.get() == thread.get()) { 223
223 thread_list.erase(it); 224 ASSERT(iter != thread_list.cend());
224 return; 225
225 } 226 thread_list.erase(iter);
226 ++it;
227 }
228 UNREACHABLE();
229} 227}
230 228
231std::vector<std::shared_ptr<Thread>> AddressArbiter::GetThreadsWaitingOnAddress(VAddr address) { 229std::vector<std::shared_ptr<Thread>> AddressArbiter::GetThreadsWaitingOnAddress(
232 std::vector<std::shared_ptr<Thread>> result; 230 VAddr address) const {
233 std::list<std::shared_ptr<Thread>>& thread_list = arb_threads[address]; 231 const auto iter = arb_threads.find(address);
234 auto it = thread_list.begin(); 232 if (iter == arb_threads.cend()) {
235 while (it != thread_list.end()) { 233 return {};
236 std::shared_ptr<Thread> current_thread = *it;
237 result.push_back(std::move(current_thread));
238 ++it;
239 } 234 }
240 return result; 235
236 const std::list<std::shared_ptr<Thread>>& thread_list = iter->second;
237 return {thread_list.cbegin(), thread_list.cend()};
241} 238}
242} // namespace Kernel 239} // namespace Kernel
diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h
index 386983e54..f958eee5a 100644
--- a/src/core/hle/kernel/address_arbiter.h
+++ b/src/core/hle/kernel/address_arbiter.h
@@ -86,7 +86,7 @@ private:
86 void RemoveThread(std::shared_ptr<Thread> thread); 86 void RemoveThread(std::shared_ptr<Thread> thread);
87 87
88 // Gets the threads waiting on an address. 88 // Gets the threads waiting on an address.
89 std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address); 89 std::vector<std::shared_ptr<Thread>> GetThreadsWaitingOnAddress(VAddr address) const;
90 90
91 /// List of threads waiting for a address arbiter 91 /// List of threads waiting for a address arbiter
92 std::unordered_map<VAddr, std::list<std::shared_ptr<Thread>>> arb_threads; 92 std::unordered_map<VAddr, std::list<std::shared_ptr<Thread>>> arb_threads;
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index e965b5b04..ad464e03b 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -474,7 +474,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) {
474 if (GetSchedulingStatus() != ThreadSchedStatus::Runnable) { 474 if (GetSchedulingStatus() != ThreadSchedStatus::Runnable) {
475 return; 475 return;
476 } 476 }
477 auto& scheduler = Core::System::GetInstance().GlobalScheduler(); 477 auto& scheduler = kernel.GlobalScheduler();
478 if (processor_id >= 0) { 478 if (processor_id >= 0) {
479 scheduler.Unschedule(old_priority, static_cast<u32>(processor_id), this); 479 scheduler.Unschedule(old_priority, static_cast<u32>(processor_id), this);
480 } 480 }
@@ -506,7 +506,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) {
506} 506}
507 507
508void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) { 508void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) {
509 auto& scheduler = Core::System::GetInstance().GlobalScheduler(); 509 auto& scheduler = kernel.GlobalScheduler();
510 if (GetSchedulingStatus() != ThreadSchedStatus::Runnable || 510 if (GetSchedulingStatus() != ThreadSchedStatus::Runnable ||
511 current_priority >= THREADPRIO_COUNT) { 511 current_priority >= THREADPRIO_COUNT) {
512 return; 512 return;
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp
index 6f5ea095a..def3410cc 100644
--- a/src/core/hle/service/bcat/backend/backend.cpp
+++ b/src/core/hle/service/bcat/backend/backend.cpp
@@ -117,13 +117,13 @@ bool NullBackend::SynchronizeDirectory(TitleIDVersion title, std::string name,
117} 117}
118 118
119bool NullBackend::Clear(u64 title_id) { 119bool NullBackend::Clear(u64 title_id) {
120 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}"); 120 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id);
121 121
122 return true; 122 return true;
123} 123}
124 124
125void NullBackend::SetPassphrase(u64 title_id, const Passphrase& passphrase) { 125void NullBackend::SetPassphrase(u64 title_id, const Passphrase& passphrase) {
126 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, passphrase = {}", title_id, 126 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, passphrase={}", title_id,
127 Common::HexToString(passphrase)); 127 Common::HexToString(passphrase));
128} 128}
129 129
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index 78e055765..0a2af54e5 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -861,7 +861,11 @@ public:
861 861
862 float point_size; 862 float point_size;
863 863
864 INSERT_UNION_PADDING_WORDS(0x7); 864 INSERT_UNION_PADDING_WORDS(0x1);
865
866 u32 point_sprite_enable;
867
868 INSERT_UNION_PADDING_WORDS(0x5);
865 869
866 u32 zeta_enable; 870 u32 zeta_enable;
867 871
@@ -1496,6 +1500,7 @@ ASSERT_REG_POSITION(vb_element_base, 0x50D);
1496ASSERT_REG_POSITION(vb_base_instance, 0x50E); 1500ASSERT_REG_POSITION(vb_base_instance, 0x50E);
1497ASSERT_REG_POSITION(clip_distance_enabled, 0x544); 1501ASSERT_REG_POSITION(clip_distance_enabled, 0x544);
1498ASSERT_REG_POSITION(point_size, 0x546); 1502ASSERT_REG_POSITION(point_size, 0x546);
1503ASSERT_REG_POSITION(point_sprite_enable, 0x548);
1499ASSERT_REG_POSITION(zeta_enable, 0x54E); 1504ASSERT_REG_POSITION(zeta_enable, 0x54E);
1500ASSERT_REG_POSITION(multisample_control, 0x54F); 1505ASSERT_REG_POSITION(multisample_control, 0x54F);
1501ASSERT_REG_POSITION(condition, 0x554); 1506ASSERT_REG_POSITION(condition, 0x554);
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 46a7433ea..b0eb14c8b 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -1220,6 +1220,7 @@ void RasterizerOpenGL::SyncPointState() {
1220 // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid 1220 // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid
1221 // in OpenGL). 1221 // in OpenGL).
1222 state.point.program_control = regs.vp_point_size.enable != 0; 1222 state.point.program_control = regs.vp_point_size.enable != 0;
1223 state.point.sprite = regs.point_sprite_enable != 0;
1223 state.point.size = std::max(1.0f, regs.point_size); 1224 state.point.size = std::max(1.0f, regs.point_size);
1224} 1225}
1225 1226
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index cc185e9e1..ab1f7983c 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -128,6 +128,7 @@ void OpenGLState::ApplyClipDistances() {
128 128
129void OpenGLState::ApplyPointSize() { 129void OpenGLState::ApplyPointSize() {
130 Enable(GL_PROGRAM_POINT_SIZE, cur_state.point.program_control, point.program_control); 130 Enable(GL_PROGRAM_POINT_SIZE, cur_state.point.program_control, point.program_control);
131 Enable(GL_POINT_SPRITE, cur_state.point.sprite, point.sprite);
131 if (UpdateValue(cur_state.point.size, point.size)) { 132 if (UpdateValue(cur_state.point.size, point.size)) {
132 glPointSize(point.size); 133 glPointSize(point.size);
133 } 134 }
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 678e5cd89..4953eeda2 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -132,6 +132,7 @@ public:
132 132
133 struct { 133 struct {
134 bool program_control = false; // GL_PROGRAM_POINT_SIZE 134 bool program_control = false; // GL_PROGRAM_POINT_SIZE
135 bool sprite = false; // GL_POINT_SPRITE
135 GLfloat size = 1.0f; // GL_POINT_SIZE 136 GLfloat size = 1.0f; // GL_POINT_SIZE
136 } point; 137 } point;
137 138