Skip to content

Commit 8646204

Browse files
committed
duckstation-unofficial: init at 0.1-9384
This is a soft-revert of duckstation's removal in NixOS#430501 (revision: f5cb574) and placing it under the `duckstation-unofficial` attribute which supports both linux and darwin platforms, most of the previously submitted code and patches still apply and this commit squashes everything together into one package file and thus is a combination of work done by different authors, listed below to the best of my ability: Co-developed-by: Marcin Serwin <[email protected]> Co-developed-by: Anderson Torres <[email protected]> Co-developed-by: OPNA2608 <[email protected]> Co-developed-by: qubitnano <[email protected]> Co-developed-by: PedroHLC ☭ <[email protected]> Co-developed-by: Artturin <[email protected]> Co-developed-by: Guillaume Bouchard <[email protected]>
1 parent 12c25b5 commit 8646204

File tree

5 files changed

+559
-0
lines changed

5 files changed

+559
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt
2+
index 633267c66..8f9c65c39 100644
3+
--- a/dep/CMakeLists.txt
4+
+++ b/dep/CMakeLists.txt
5+
@@ -25,9 +25,9 @@ add_subdirectory(rcheevos EXCLUDE_FROM_ALL)
6+
disable_compiler_warnings_for_target(rcheevos)
7+
add_subdirectory(rapidyaml EXCLUDE_FROM_ALL)
8+
disable_compiler_warnings_for_target(rapidyaml)
9+
-add_subdirectory(cubeb EXCLUDE_FROM_ALL)
10+
-disable_compiler_warnings_for_target(cubeb)
11+
-disable_compiler_warnings_for_target(speex)
12+
+find_package(cubeb REQUIRED GLOBAL)
13+
+add_library(cubeb ALIAS cubeb::cubeb)
14+
+# disable_compiler_warnings_for_target(speex)
15+
16+
if(ENABLE_OPENGL)
17+
add_subdirectory(glad EXCLUDE_FROM_ALL)
18+
diff --git a/src/util/cubeb_audio_stream.cpp b/src/util/cubeb_audio_stream.cpp
19+
index e01cbfe78..294c6e59d 100644
20+
--- a/src/util/cubeb_audio_stream.cpp
21+
+++ b/src/util/cubeb_audio_stream.cpp
22+
@@ -261,9 +261,9 @@ std::vector<std::pair<std::string, std::string>> AudioStream::GetCubebDriverName
23+
std::vector<std::pair<std::string, std::string>> names;
24+
names.emplace_back(std::string(), TRANSLATE_STR("AudioStream", "Default"));
25+
26+
- const char** cubeb_names = cubeb_get_backend_names();
27+
- for (u32 i = 0; cubeb_names[i] != nullptr; i++)
28+
- names.emplace_back(cubeb_names[i], cubeb_names[i]);
29+
+ cubeb_backend_names cubeb_names = cubeb_get_backend_names();
30+
+ for (u32 i = 0; i < cubeb_names.count; i++)
31+
+ names.emplace_back(cubeb_names.names[i], cubeb_names.names[i]);
32+
return names;
33+
}
34+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
From 19e094e5c7aaaf375a13424044521701e85c8313 Mon Sep 17 00:00:00 2001
2+
From: OPNA2608 <[email protected]>
3+
Date: Thu, 9 Jan 2025 17:46:25 +0100
4+
Subject: [PATCH] Fix usage of NEON intrinsics
5+
6+
---
7+
src/common/gsvector_neon.h | 12 ++++++------
8+
1 file changed, 6 insertions(+), 6 deletions(-)
9+
10+
diff --git a/src/common/gsvector_neon.h b/src/common/gsvector_neon.h
11+
index e4991af5e..61b8dc09b 100644
12+
--- a/src/common/gsvector_neon.h
13+
+++ b/src/common/gsvector_neon.h
14+
@@ -867,7 +867,7 @@ public:
15+
16+
ALWAYS_INLINE int mask() const
17+
{
18+
- const uint32x2_t masks = vshr_n_u32(vreinterpret_u32_s32(v2s), 31);
19+
+ const uint32x2_t masks = vshr_n_u32(vreinterpret_u32_f32(v2s), 31);
20+
return (vget_lane_u32(masks, 0) | (vget_lane_u32(masks, 1) << 1));
21+
}
22+
23+
@@ -2882,7 +2882,7 @@ public:
24+
ALWAYS_INLINE GSVector4 gt64(const GSVector4& v) const
25+
{
26+
#ifdef CPU_ARCH_ARM64
27+
- return GSVector4(vreinterpretq_f32_f64(vcgtq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
28+
+ return GSVector4(vreinterpretq_f32_u64(vcgtq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
29+
#else
30+
GSVector4 ret;
31+
ret.U64[0] = (F64[0] > v.F64[0]) ? 0xFFFFFFFFFFFFFFFFULL : 0;
32+
@@ -2894,7 +2894,7 @@ public:
33+
ALWAYS_INLINE GSVector4 eq64(const GSVector4& v) const
34+
{
35+
#ifdef CPU_ARCH_ARM64
36+
- return GSVector4(vreinterpretq_f32_f64(vceqq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
37+
+ return GSVector4(vreinterpretq_f32_u64(vceqq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
38+
#else
39+
GSVector4 ret;
40+
ret.U64[0] = (F64[0] == v.F64[0]) ? 0xFFFFFFFFFFFFFFFFULL : 0;
41+
@@ -2906,7 +2906,7 @@ public:
42+
ALWAYS_INLINE GSVector4 lt64(const GSVector4& v) const
43+
{
44+
#ifdef CPU_ARCH_ARM64
45+
- return GSVector4(vreinterpretq_f32_f64(vcgtq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
46+
+ return GSVector4(vreinterpretq_f32_u64(vcgtq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
47+
#else
48+
GSVector4 ret;
49+
ret.U64[0] = (F64[0] < v.F64[0]) ? 0xFFFFFFFFFFFFFFFFULL : 0;
50+
@@ -2918,7 +2918,7 @@ public:
51+
ALWAYS_INLINE GSVector4 ge64(const GSVector4& v) const
52+
{
53+
#ifdef CPU_ARCH_ARM64
54+
- return GSVector4(vreinterpretq_f32_f64(vcgeq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
55+
+ return GSVector4(vreinterpretq_f32_u64(vcgeq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
56+
#else
57+
GSVector4 ret;
58+
ret.U64[0] = (F64[0] >= v.F64[0]) ? 0xFFFFFFFFFFFFFFFFULL : 0;
59+
@@ -2930,7 +2930,7 @@ public:
60+
ALWAYS_INLINE GSVector4 le64(const GSVector4& v) const
61+
{
62+
#ifdef CPU_ARCH_ARM64
63+
- return GSVector4(vreinterpretq_f32_f64(vcleq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
64+
+ return GSVector4(vreinterpretq_f32_u64(vcleq_f64(vreinterpretq_f64_f32(v4s), vreinterpretq_f64_f32(v.v4s))));
65+
#else
66+
GSVector4 ret;
67+
ret.U64[0] = (F64[0] <= v.F64[0]) ? 0xFFFFFFFFFFFFFFFFULL : 0;
68+
--
69+
2.47.0
70+

0 commit comments

Comments
 (0)