mirror of
https://github.com/ARMSX2/ARMSX3.git
synced 2026-08-24 16:58:52 -07:00
Revert the frame-generation work entirely
Both changes that were brought back are out again. Neither recovered the frame rate after switching frame generation off, and both broke rendering. That is every attempt at this reverted. What remains is the code as it stood before any of it: frame generation is slow, and switching it off does not release what it allocated. The GLES DSA shim is kept, because it belongs to the upstream merge and not to this work -- it landed in the wrong commit and reverting that commit took it with it, which broke the build for a reason unrelated to frame generation. The findings from the three audits are still correct as descriptions of what the code does. Acting on them, one at a time and with the reasoning written down each time, still made the result worse on every attempt. So the fault is not in the individual fixes but in something about this subsystem that reading it has not revealed, and the next attempt should start from a measurement on the device rather than from another reading of the source.
This commit is contained in:
Vendored
-1
@@ -19,7 +19,6 @@
|
||||
armsx3_lsfg_initialize;
|
||||
armsx3_lsfg_create_context_ahb;
|
||||
armsx3_lsfg_present;
|
||||
armsx3_lsfg_present_fenced;
|
||||
armsx3_lsfg_destroy_context;
|
||||
armsx3_lsfg_wait_idle;
|
||||
armsx3_lsfg_finalize;
|
||||
|
||||
Vendored
+2
-22
@@ -184,22 +184,6 @@ extern "C" int32_t armsx3_lsfg_create_context_ahb(void* in0, void* in1, void* co
|
||||
|
||||
extern "C" int armsx3_lsfg_present(int32_t ctx, int in_sem, const int* out_sems, uint32_t out_count)
|
||||
{
|
||||
// Forwarded rather than duplicated. Asking for no fence descriptor is exactly what this
|
||||
// always did, and keeping one body means the two entry points cannot drift.
|
||||
return armsx3_lsfg_present_fenced(ctx, in_sem, out_sems, out_count, nullptr);
|
||||
}
|
||||
|
||||
extern "C" int armsx3_lsfg_present_fenced(int32_t ctx, int in_sem, const int* out_sems,
|
||||
uint32_t out_count, int* out_fence_fd)
|
||||
{
|
||||
if (out_fence_fd)
|
||||
{
|
||||
// Written before anything that can fail. Every path out of here leaves the caller with a
|
||||
// value it can act on, so it can never read an uninitialised int and close a descriptor
|
||||
// belonging to something else -- which on Android is somebody's socket or an open asset.
|
||||
*out_fence_fd = -1;
|
||||
}
|
||||
|
||||
if (!g_initialized)
|
||||
{
|
||||
set_error("not initialized");
|
||||
@@ -214,17 +198,13 @@ extern "C" int armsx3_lsfg_present_fenced(int32_t ctx, int in_sem, const int* ou
|
||||
outs.push_back(out_sems ? out_sems[i] : -1);
|
||||
}
|
||||
|
||||
// framegen writes the descriptor itself and leaves it at -1 when it cannot produce one, so a
|
||||
// null out_fence_fd degrades to the plain present without a second code path here.
|
||||
if (g_performance)
|
||||
{
|
||||
ARMSX3_LSFG_GUARD(LSFG_3_1P::presentContextFenced(ctx, in_sem, outs, out_fence_fd),
|
||||
ARMSX3_LSFG_ERR_VULKAN)
|
||||
ARMSX3_LSFG_GUARD(LSFG_3_1P::presentContext(ctx, in_sem, outs), ARMSX3_LSFG_ERR_VULKAN)
|
||||
}
|
||||
else
|
||||
{
|
||||
ARMSX3_LSFG_GUARD(LSFG_3_1::presentContextFenced(ctx, in_sem, outs, out_fence_fd),
|
||||
ARMSX3_LSFG_ERR_VULKAN)
|
||||
ARMSX3_LSFG_GUARD(LSFG_3_1::presentContext(ctx, in_sem, outs), ARMSX3_LSFG_ERR_VULKAN)
|
||||
}
|
||||
|
||||
return ARMSX3_LSFG_OK;
|
||||
|
||||
Vendored
+1
-24
@@ -29,7 +29,7 @@ extern "C" {
|
||||
// Bump when anything below changes shape. The loader refuses a library whose version it does not
|
||||
// recognise, so a stale libarmsx3_lsfg.so on a user's device fails loudly at load instead of
|
||||
// quietly passing mismatched structs.
|
||||
#define ARMSX3_LSFG_ABI_VERSION 3u
|
||||
#define ARMSX3_LSFG_ABI_VERSION 2u
|
||||
|
||||
// Mark the exported surface explicitly.
|
||||
//
|
||||
@@ -103,29 +103,6 @@ ARMSX3_LSFG_API int32_t armsx3_lsfg_create_context_ahb(void* in0, void* in1, voi
|
||||
// each out_sems[i] is signalled when output image i is ready. Pass -1 for an unused slot.
|
||||
ARMSX3_LSFG_API int armsx3_lsfg_present(int32_t ctx, int in_sem, const int* out_sems, uint32_t out_count);
|
||||
|
||||
// Generate frames for one presented pair, and hand back a fence for the result.
|
||||
//
|
||||
// Identical to armsx3_lsfg_present in every respect except that *out_fence_fd receives a sync file
|
||||
// descriptor that becomes readable once the generation this call submitted has finished. The
|
||||
// caller owns that fd and must close(2) it.
|
||||
//
|
||||
// This is the answer to armsx3_lsfg_wait_idle() below being the only completion signal on offer.
|
||||
// framegen renders on its OWN VkDevice, so the caller cannot wait on its queues; before this
|
||||
// entry point existed the only way to know the generated images were ready -- and, more
|
||||
// importantly, that framegen had finished READING the caller's input images -- was a
|
||||
// vkDeviceWaitIdle on framegen's device, once per presented frame. A sync fd can be waited on
|
||||
// with poll(2) instead, which parks a thread rather than draining a GPU.
|
||||
//
|
||||
// *out_fence_fd is set to -1 whenever a descriptor is not available: an older library, a driver
|
||||
// without VK_KHR_external_fence_fd, or work that had already completed by the time it was asked
|
||||
// for. -1 is not an error and the return code is still ARMSX3_LSFG_OK -- the caller must fall
|
||||
// back to armsx3_lsfg_wait_idle(), which is always correct.
|
||||
//
|
||||
// Added in ABI 3. Resolve it with dlsym rather than assuming it: this is the one entry point a
|
||||
// caller can do without.
|
||||
ARMSX3_LSFG_API int armsx3_lsfg_present_fenced(int32_t ctx, int in_sem, const int* out_sems,
|
||||
uint32_t out_count, int* out_fence_fd);
|
||||
|
||||
ARMSX3_LSFG_API int armsx3_lsfg_destroy_context(int32_t ctx);
|
||||
|
||||
// Read the user's own Lossless.dll and keep the shaders it contains.
|
||||
|
||||
Reference in New Issue
Block a user