mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
chore: remove source comments and unused code, translate every missing string (#1965)
* chore(i18n): translate every missing string in all locales Adds the 87 strings the bottom-screen Dashboard and in-game stats pages introduced to all 32 locales, plus the 51 older settings strings Japanese and the 50 Chinese locales were still missing. Every locale now has all 3456 translatable strings with the same placeholders as English. Also translates 36 entries that were still English where the language does not use the English word, and makes es-419 touch_app_id use the same %1$s placeholder as English. * chore(patches): drop comments from the lines downstream patches add Removes comment lines and trailing comments from lines our patches add, with hunk headers recounted. Lines that a later patch uses as context and the upstream backport 0123 are left as they are. The gamescope, FEX, proot and xodus series still apply to their pinned sources, and the patched trees differ only in those comments. test_hud_frames now finds the HUD writer by its first declaration. * docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix These were credited only in source headers and NOTICE files. * chore: remove source comments and unused functions Removes explanatory comments from first-party Kotlin, Java, C, C++, Rust, TypeScript, Python, shell, Gradle, CMake and workflow files. License and attribution headers stay, and vendored third-party trees, generated files and license files are untouched. A shellcheck directive is kept, and udevmon's fallthrough comments became fallthrough attributes. Syntax trees and token streams match the previous sources apart from the comments and Python docstrings. Module docstrings that argparse prints are kept, and device-smoke.sh prints the same --help text from a heredoc. Also removes 37 functions and 4 fields that nothing referenced. * chore: remove comments from the Syncthing integration and the latest main sources * docs: credit Syncthing and the syncthing-android fork * chore(i18n): translate the Syncthing strings in all locales The 107 strings the Syncthing integration added are now in all 32 locales. sync_web_path_locked names the Syncthing tab by its label. * docs: credit @xXJSONDeruloXx for the HUD metric readers The CPU, GPU load, thermal and battery readers come from their PerformanceHudView pull requests #777, #877, #991, #1406 and #1573. The FusionHUD credit line is unchanged. * docs: credit the HUD metric readers to @xXJSONDeruloXx's work
This commit is contained in:
1 parent
d730f0fa8b
commit
c5577478ca
511 files changed
+6813
-4068
No files matched your search
@@ -281,7 +281,6 @@ public:
|
||||
const uint32_t create = 0x8 ;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
SharedTextureHandle_t h = 0;
|
||||
// Compute access makes SteamVR substitute UNORM for sRGB, darkening direct compositor output.
|
||||
if (!VRIPCResourceManager()->NewSharedVulkanImage(d->nFormat, d->nWidth, d->nHeight, true, false, false, 1, 1,
|
||||
create, usage, &h)) {
|
||||
Log("NewSharedVulkanImage failed");
|
||||
@@ -1276,7 +1275,6 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
// Face buttons, menus and the stick, for both the game pad and optical hands.
|
||||
void UpdatePadButtons(uint32_t b, float stickX, float stickY, bool stickToGame) {
|
||||
auto in = VRDriverInput();
|
||||
const bool touch = stickToGame && stickX * stickX + stickY * stickY > 0.01f;
|
||||
@@ -1289,7 +1287,6 @@ private:
|
||||
in->UpdateBooleanComponent(padClick_, (b & (right_ ? (PAD_A | PAD_R3) : PAD_X)) != 0, 0);
|
||||
return;
|
||||
}
|
||||
// Touch and Index: face buttons are their own inputs and the stick is a thumbstick.
|
||||
const bool primary = b & (right_ ? PAD_A : PAD_X), secondary = b & (right_ ? PAD_B : PAD_Y);
|
||||
const bool both = (b & PAD_L3) && (b & PAD_R3);
|
||||
if (menu_) in->UpdateBooleanComponent(menu_, !right_ && (b & (PAD_START | PAD_SELECT)), 0);
|
||||
@@ -1754,7 +1751,6 @@ public:
|
||||
void SetHands(CardboardController *left, CardboardController *right) { hands_[0] = left; hands_[1] = right; }
|
||||
void SetSticksMoveHands(bool on) { sticksMoveHands_ = on; }
|
||||
|
||||
// Called only from the pose thread: a replaced pair is disconnected there, so it never races an update.
|
||||
CardboardController *ActiveHand(int side) {
|
||||
CardboardController *wanted = hands_[side].load();
|
||||
if (wanted != active_[side]) {
|
||||
@@ -1908,10 +1904,7 @@ private:
|
||||
target.frequency = std::max(pulse.fFrequency, 0.f);
|
||||
__atomic_store_n(&haptics_->seq, (sequence | 1u) + 1u, __ATOMIC_RELEASE);
|
||||
}
|
||||
// SteamVR fixes a device's input profile when it activates, so each type gets its own pair,
|
||||
// added the first time it is chosen; devices cannot be removed, only disconnected.
|
||||
void ApplyPadConfig(bool initial) {
|
||||
// The file is a few bytes, so compare what it says; two quick writes can share an mtime.
|
||||
const PadControllerConfig pads = read_pad_controller_config("/run/droiddeck/" DROIDDECK_VR_CONTROLLERS_FILE);
|
||||
if (!initial && pads.profile == configProfile_ && pads.sticksMoveHands == configSticks_) return;
|
||||
configProfile_ = pads.profile;
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
/* All pool operations require the caller's tracker lock. Reserved fences are
|
||||
* invisible to the completer until vkQueueSubmit has returned successfully. */
|
||||
struct tracked {
|
||||
struct tracked *next;
|
||||
VkDevice dev;
|
||||
@@ -33,8 +31,6 @@ static struct tracked *track_pool_take(struct tracked **pool, VkDevice dev, PFN_
|
||||
t.destroy = (PFN_vkDestroyFence)gdpa(dev, "vkDestroyFence");
|
||||
PFN_vkCreateFence create = (PFN_vkCreateFence)gdpa(dev, "vkCreateFence");
|
||||
if (!t.wait || !t.reset || !t.destroy || !create) return NULL;
|
||||
/* Never wait for a slot: the next submission may signal a semaphore that
|
||||
* every outstanding fence is waiting on. Grow only at the high-water mark. */
|
||||
struct tracked *slot = idle ? idle : calloc(1, sizeof(*slot));
|
||||
if (!slot) return NULL;
|
||||
VkFenceCreateInfo fci = {VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, NULL, 0};
|
||||
@@ -69,8 +65,6 @@ static int track_pool_reap(struct tracked *pool, uint32_t issued, uint32_t *done
|
||||
uint32_t through = issued;
|
||||
for (struct tracked *t = pool; t; t = t->next) {
|
||||
if (t->state != TRACK_SUBMITTED) continue;
|
||||
/* Scan all fences without blocking behind an earlier submission on a
|
||||
* different queue. Device loss retires fences as in the previous path. */
|
||||
if (t->wait(t->dev, 1, &t->fence, VK_TRUE, 0) == VK_TIMEOUT) {
|
||||
pending = 1;
|
||||
if ((int32_t)(t->mark - through) <= 0) through = t->mark - 1;
|
||||
@@ -79,9 +73,6 @@ static int track_pool_reap(struct tracked *pool, uint32_t issued, uint32_t *done
|
||||
t->state = TRACK_IDLE;
|
||||
}
|
||||
}
|
||||
/* done is a contiguous watermark, not a count of completed fences. Later
|
||||
* work may free its slot but cannot release an unfinished presenter frame.
|
||||
* Signed differences also handle the uint32_t counter wrapping. */
|
||||
*done = through;
|
||||
return pending;
|
||||
}
|
||||
@@ -92,7 +83,6 @@ static int track_pool_device_busy(struct tracked *pool, VkDevice dev) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The caller must first wait for all this device's reservations and work. */
|
||||
static void track_pool_forget(struct tracked **pool, VkDevice dev) {
|
||||
for (struct tracked **p = pool; *p;) {
|
||||
struct tracked *t = *p;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Adapted from Valve's OpenVR handskeletonsimulation driver sample (BSD-3-Clause, see OPENVR_LICENSE),
|
||||
// which follows Moshi Turner's hand simulation in Monado.
|
||||
// Adapted from Valve's OpenVR handskeletonsimulation driver sample (BSD-3-Clause, see OPENVR_LICENSE), which follows Moshi Turner's hand simulation in Monado.
|
||||
#pragma once
|
||||
|
||||
#include "arm_model.h"
|
||||
|
||||
@@ -11,7 +11,6 @@ struct PadControllerConfig {
|
||||
bool sticksMoveHands = false;
|
||||
};
|
||||
|
||||
// One key=value per line, written by the app before SteamVR starts.
|
||||
inline PadControllerConfig pad_controller_config(const char *text) {
|
||||
PadControllerConfig config;
|
||||
if (!text) return config;
|
||||
|
||||
@@ -606,7 +606,6 @@ private:
|
||||
im.height = p.height;
|
||||
im.producerPid = p.producerPid;
|
||||
im.format = (VkFormat)p.format;
|
||||
// Dedicated OPAQUE_FD imports must match SteamVR's exported image description.
|
||||
SharedEyeImage description(im.format, p.width, p.height);
|
||||
VkResult r = vk_.CreateImage(dev_, &description.info, nullptr, &im.image);
|
||||
if (r != VK_SUCCESS) { Log("presenter: import image %d", r); close(p.fd); return; }
|
||||
|
||||
@@ -28,7 +28,6 @@ int setrlimit(__rlimit_resource_t resource, const struct rlimit *limit) {
|
||||
struct rlimit current;
|
||||
if (!getrlimit(resource, ¤t) &&
|
||||
(limit->rlim_cur < current.rlim_cur || limit->rlim_max < current.rlim_max)) {
|
||||
// SDL's failed RTKit fallback leaves a fatal RT budget on Android GPU submissions.
|
||||
errno = EPERM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,6 @@ struct OpticalPose {
|
||||
}
|
||||
auto target = filtered;
|
||||
if (predict) {
|
||||
// Inference already consumes most capture age; receipt-relative prediction advances between results.
|
||||
float seconds = std::clamp(float(now-receivedAt)/1e9f,0.f,.08f);
|
||||
float speed2 = 0;
|
||||
for (float v : velocity) speed2 += v*v;
|
||||
|
||||
@@ -981,8 +981,6 @@ static int submit_drop_wait(VkSemaphore s, uint64_t value) {
|
||||
for (;;) {
|
||||
uint64_t local = 0;
|
||||
if (get(dev, s, &local) == VK_SUCCESS && local >= value) return 0;
|
||||
/* Only the poller mirrors shared values. A second host signal here can
|
||||
* race its signal and submit the same timeline value twice. */
|
||||
if (now_us() >= until) break;
|
||||
usleep(100);
|
||||
}
|
||||
@@ -1073,7 +1071,7 @@ static void *completer(void *arg) {
|
||||
if (pending) {
|
||||
struct timespec until;
|
||||
clock_gettime(CLOCK_REALTIME, &until);
|
||||
until.tv_nsec += 1000000; /* Poll pending GPU work at most every 1 ms. */
|
||||
until.tv_nsec += 1000000;
|
||||
if (until.tv_nsec >= 1000000000) { until.tv_sec++; until.tv_nsec -= 1000000000; }
|
||||
pthread_cond_timedwait(&g_trk_cond, &g_trk_lock, &until);
|
||||
} else {
|
||||
@@ -1345,8 +1343,6 @@ static VkResult VKAPI_CALL CreateImage(VkDevice d, const VkImageCreateInfo *ci,
|
||||
VkImageCreateInfo compatible = *ci;
|
||||
VkExternalMemoryImageCreateInfo shared;
|
||||
const VkBaseInStructure *first = ci->pNext;
|
||||
// SteamVR's OpenXR stereo arrays omit a format list, while DXVK adds one on import.
|
||||
// Leave single-layer OpenVR images alone: the application owns their export layout.
|
||||
if (dev_for(d)->quest_images && ci->arrayLayers > 1 && (ci->flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) && ci->tiling == VK_IMAGE_TILING_OPTIMAL
|
||||
&& first && first->sType == VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO) {
|
||||
const VkBaseInStructure *second = first->pNext;
|
||||
|
||||
@@ -395,7 +395,6 @@ extern "C" VkResult droiddeck_wsi_present(VkDevice device, VkQueue queue, const
|
||||
VkResult result = it->second->Capture(queue, present->pImageIndices[0], *present, &completion);
|
||||
if (result) return result;
|
||||
if (!completion) return next(queue, present);
|
||||
// Reacquiring this swapchain image also proves its previous present wait semaphore is reusable.
|
||||
VkPresentInfoKHR copy = *present; copy.waitSemaphoreCount = 1; copy.pWaitSemaphores = &completion;
|
||||
return next(queue, ©);
|
||||
} catch (...) {
|
||||
|
||||
@@ -9,7 +9,6 @@ struct DroidDeckXrRenderView {
|
||||
|
||||
inline void xr_frame_projection_raw(const float fov[4], float *left, float *right, float *top, float *bottom) {
|
||||
*left = std::tan(fov[0]); *right = std::tan(fov[1]);
|
||||
// OpenVR's top/bottom parameters are the lower/upper Y bounds in its projection formula.
|
||||
*top = std::tan(fov[3]); *bottom = std::tan(fov[2]);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ inline XrGpuFrameState xr_gpu_frame_state(const XrGpuFrame &frame, uint32_t widt
|
||||
return now - frame.header.captured_ns > 200000000LL ? XrGpuFrameState::Stale : XrGpuFrameState::Ready;
|
||||
}
|
||||
|
||||
// SEQPACKET keeps descriptor transfer and its metadata in one indivisible message.
|
||||
inline bool xr_gpu_send(int socket, const void *data, size_t size, const int *fds = nullptr, unsigned count = 0) {
|
||||
if (count > XR_GPU_SLOTS) return false;
|
||||
iovec bytes{const_cast<void *>(data), size};
|
||||
|
||||
Reference in new issue
Block a user