mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
* 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
95 lines
2.9 KiB
C
95 lines
2.9 KiB
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include <vulkan/vulkan.h>
|
|
|
|
struct tracked {
|
|
struct tracked *next;
|
|
VkDevice dev;
|
|
VkFence fence;
|
|
PFN_vkWaitForFences wait;
|
|
PFN_vkResetFences reset;
|
|
PFN_vkDestroyFence destroy;
|
|
uint32_t mark;
|
|
enum { TRACK_IDLE, TRACK_RESERVED, TRACK_SUBMITTED } state;
|
|
};
|
|
|
|
static struct tracked *track_pool_take(struct tracked **pool, VkDevice dev, PFN_vkGetDeviceProcAddr gdpa) {
|
|
struct tracked *idle = NULL;
|
|
for (struct tracked *t = *pool; t; t = t->next) {
|
|
if (t->state != TRACK_IDLE) continue;
|
|
if (t->dev == dev) {
|
|
t->state = TRACK_RESERVED;
|
|
return t;
|
|
}
|
|
if (!idle) idle = t;
|
|
}
|
|
struct tracked t = {.dev = dev, .state = TRACK_RESERVED};
|
|
t.wait = (PFN_vkWaitForFences)gdpa(dev, "vkWaitForFences");
|
|
t.reset = (PFN_vkResetFences)gdpa(dev, "vkResetFences");
|
|
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;
|
|
struct tracked *slot = idle ? idle : calloc(1, sizeof(*slot));
|
|
if (!slot) return NULL;
|
|
VkFenceCreateInfo fci = {VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, NULL, 0};
|
|
if (create(dev, &fci, NULL, &t.fence) != VK_SUCCESS) {
|
|
if (!idle) free(slot);
|
|
return NULL;
|
|
}
|
|
if (idle) {
|
|
idle->destroy(idle->dev, idle->fence, NULL);
|
|
t.next = idle->next;
|
|
} else {
|
|
t.next = *pool;
|
|
*pool = slot;
|
|
}
|
|
*slot = t;
|
|
return slot;
|
|
}
|
|
|
|
static uint32_t track_pool_submitted(struct tracked *t, VkResult result, uint32_t issued) {
|
|
if (result == VK_SUCCESS) {
|
|
t->mark = ++issued;
|
|
t->state = TRACK_SUBMITTED;
|
|
} else {
|
|
t->reset(t->dev, 1, &t->fence);
|
|
t->state = TRACK_IDLE;
|
|
}
|
|
return issued;
|
|
}
|
|
|
|
static int track_pool_reap(struct tracked *pool, uint32_t issued, uint32_t *done) {
|
|
int pending = 0;
|
|
uint32_t through = issued;
|
|
for (struct tracked *t = pool; t; t = t->next) {
|
|
if (t->state != TRACK_SUBMITTED) continue;
|
|
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;
|
|
} else {
|
|
t->reset(t->dev, 1, &t->fence);
|
|
t->state = TRACK_IDLE;
|
|
}
|
|
}
|
|
*done = through;
|
|
return pending;
|
|
}
|
|
|
|
static int track_pool_device_busy(struct tracked *pool, VkDevice dev) {
|
|
for (struct tracked *t = pool; t; t = t->next)
|
|
if (t->dev == dev && t->state != TRACK_IDLE) return 1;
|
|
return 0;
|
|
}
|
|
|
|
static void track_pool_forget(struct tracked **pool, VkDevice dev) {
|
|
for (struct tracked **p = pool; *p;) {
|
|
struct tracked *t = *p;
|
|
if (t->dev != dev) { p = &t->next; continue; }
|
|
t->destroy(t->dev, t->fence, NULL);
|
|
*p = t->next;
|
|
free(t);
|
|
}
|
|
}
|