diff options
Diffstat (limited to 'steamvr')
| -rw-r--r-- | steamvr/driver_vrlink/ack-window.c | 35 | ||||
| -rw-r--r-- | steamvr/patches.toml | 81 | ||||
| -rw-r--r-- | steamvr/vrcompositor/vulkan-wait.c | 12 |
3 files changed, 28 insertions, 100 deletions
diff --git a/steamvr/driver_vrlink/ack-window.c b/steamvr/driver_vrlink/ack-window.c deleted file mode 100644 index acd668d..0000000 --- a/steamvr/driver_vrlink/ack-window.c +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-FileCopyrightText: 2026 Tomasz Kramkowski <tomasz@kramkow.ski> -// SPDX-License-Identifier: CC0-1.0 - -#include <layout.h> -#include <stdint.h> -#include <trampoline.h> - -struct Transmitter { - unsigned char unknown_000[0x17c]; - int32_t next_frame; // -1 before the first frame is issued - int32_t last_ack; - int32_t cutoff; -}; -ASSERT_OFFSET(struct Transmitter, next_frame, 0x17c); -ASSERT_OFFSET(struct Transmitter, last_ack, 0x180); -ASSERT_OFFSET(struct Transmitter, cutoff, 0x184); - -void maybe_update_ack(struct Transmitter *tx, uint32_t incoming) -{ - if (tx->next_frame < 0) return; - uint16_t behind = (uint16_t)(tx->next_frame - 1 - incoming); - if (behind >= 0x8000) return; - - if (tx->cutoff >= 0 && (uint16_t)(incoming - tx->cutoff) >= 0x8000) return; - tx->last_ack = incoming; - tx->cutoff = incoming; -} - -// Hooks where the current code checks an incoming ack, clears the cutoff, and -// updates the last ack. The intent is to specifically replace all of that. -TRAMPOLINE( - accept_ack, CALL(maybe_update_ack, 0, "r8", - "mov rdi, rbx\n" - "mov esi, eax\n") "jmp resume_ack\n" -); diff --git a/steamvr/patches.toml b/steamvr/patches.toml index d0f3698..5a677ab 100644 --- a/steamvr/patches.toml +++ b/steamvr/patches.toml @@ -1,18 +1,12 @@ # SPDX-FileCopyrightText: 2026 Tomasz Kramkowski <tomasz@kramkow.ski> # SPDX-License-Identifier: CC0-1.0 -target = "Beta 2.19.3, build 26655409" +target = "Beta 2.19.4, build 26793788" [[targets]] path = "bin/linux64/vrcompositor" -sha256 = "b3747b541c86f683286f13fcce9ed7761e0258ecef3827c5ce915167226947fe" +sha256 = "2916c9993a27d49cdc693a540eefda3ca1d50a569a53edf1bc3b1ea7e19e688e" edits = [ - # Stop reusing GPU work identifiers across frames so that the (now fixed - # upstream) wait on prior GPU work waits on the _correct_ work (#952). - # TODO: Maybe this _can't_ actually happen? Needs more investigation. - [0x41eb34, "31c09090909090"], - [0x41f449, "31c09090909090"], - [0x41f484, "909090909090"], # Fix shader descriptor texture array counts (should be 3, not 1) for # bindings 9, 17, and 20. Affected shaders: # - distort_none_ps @@ -20,34 +14,21 @@ edits = [ # - distort_panorama_ps # - distort_panorama_solid_color_ps # - distort_ps_achromatic_nd - [0x4061c1, "498b5500b80300000089424ceb22"], - [0x4061f1, "89828c0000008982a4000000eb12"], - [0x406211, "4c8bbd18feffffe9b2200100"], - [0x4182c8, "e9f4defeff9090"], - # Increase Vulkan descriptor pool capacity from 200 to 1024. (#1067) - # Some games hit this (including Alyx for me since 2.19.3, despite the - # limit pre-dating this version) limit and crash since the error handling - # consists of logging, followed ignoring the error and passing a NULL - # pointer back to Vulkan. - # The correct fix would be to resize when the limit is hit. But 200 seemed - # to have worked for a long time so 1024 _ought to be enough for - # anybody_... - [0x4365ba, "00200000"], - [0x4365c9, "00100000"], - [0x4365e0, "00400000"], - [0x4365f3, "00400000"], - [0x436614, "00040000"], + [0x4098d1, "498b5500b80300000089424ceb02"], + [0x4098e1, "89828c0000008982a4000000eb02"], + [0x4098f1, "4c8bbd18feffffe9f2200100"], + [0x41b9e8, "e9e4defeff9090"], ] [targets.compiled] sources = ["vrcompositor/vulkan-wait.c", "vrcompositor/facet-wait.c"] [targets.compiled.imports] -pthread_mutex_lock = 0x157320 -pthread_mutex_unlock = 0x157710 -facet_wait_hook_end = 0x410277 -vulkan_wait_hook_end = 0x4313c2 -append_wait = 0x468180 +pthread_mutex_lock = 0x1592a0 +pthread_mutex_unlock = 0x159690 +facet_wait_hook_end = 0x413a07 +vulkan_wait_hook_end = 0x434d72 +append_wait = 0x46d470 # Add semaphore waits for things that may be eye textures (among other things, # but it seems harmless). @@ -56,48 +37,30 @@ append_wait = 0x468180 # is chosen when isn't totally clear to me. [[targets.compiled.hooks]] -address = 0x4313bb +address = 0x434d6b length = 7 target = "vulkan_wait_hook" [[targets.compiled.hooks]] -address = 0x410270 +address = 0x413a00 length = 7 target = "facet_wait_hook" [[targets]] path = "drivers/vrlink/bin/linux64/driver_vrlink.so" -sha256 = "b78a5a6bbfcb0cd80cd44f4b88ed97f5a93110ad62ebaaffff20768d0a7a9135" +sha256 = "7b6a49016989091e36b1276b949aecdb2bf0365353380b12dc7e9b66fb7d797d" edits = [ - # Ignore stale tracking IDs and repeated older tracking attempts - [0x116581, "89d02b47084189c6c1e004"], - [0x11658c, "0f8853050000"], - [0x116894, "0f84970ffdff"], - [0xe7831, "410fb644240988430ee9a6f20200"], + # Ignore stale tracking IDs + [0x1177c1, "89d02b47084189c6c1e004"], + [0x1177cc, "0f88ce050000"], # Reset tracking and encoding when starting a new streaming session. # The tracking ID rejection code above could otherwise drop some packets # after a reconnect (since their IDs will start from 0 again). # Resetting the encoder eagerly here avoids the high chance it will end up # reset due to errors shortly after. - [0x10db61, "57488b7f184885ff740feb04"], - [0x10db71, "488b076a015eff50285fe91013feff"], - [0x1154c1, "4c89a30804000031c0894308c3"], - [0x115511, "e8abffffff6690"], - [0x115524, "e83886ffff"], + [0x10eb51, "57488b7f184885ff740feb04"], + [0x10eb61, "488b076a015eff50285fe99018feff"], + [0x116701, "4c89a30804000031c0894308c3"], + [0x116751, "e8abffffff6690"], + [0x116764, "e8e883ffff"], ] - -# Don't clear the ACK cutoff. Also ignore ACKs which are beyond the latest -# frame ID. This is mainly to avoid the case where the headset erroneously -# sends an ack for frame ID 0 after a reconnect before it has anything to -# acknowledge. -# The current headset patch fixes this, but people aren't as eager to patch the -# headset as it's a bit more complicated, and it's not hard to add a workaround -# here. It improves robustness regardless. -[targets.compiled] -sources = ["driver_vrlink/ack-window.c"] -imports = { resume_ack = 0xd8a77 } - -[[targets.compiled.hooks]] -address = 0xd8a58 -length = 6 -target = "accept_ack" diff --git a/steamvr/vrcompositor/vulkan-wait.c b/steamvr/vrcompositor/vulkan-wait.c index 8b915f4..248d203 100644 --- a/steamvr/vrcompositor/vulkan-wait.c +++ b/steamvr/vrcompositor/vulkan-wait.c @@ -29,17 +29,17 @@ struct Renderer { uint32_t current_queue; unsigned char unknown_23c[4]; struct NativeDevice queues[2]; - unsigned char unknown_260[0x10a0 - 0x260]; + unsigned char unknown_260[0x1100 - 0x260]; SemaphoreEntry *signals; SemaphoreEntry *signals_end; - unsigned char unknown_10b0[0x1520 - 0x10b0]; + unsigned char unknown_1110[0x15c8 - 0x1110]; pthread_mutex_t queue_mutex; }; ASSERT_OFFSET(struct Renderer, current_queue, 0x238); ASSERT_OFFSET(struct Renderer, queues, 0x240); -ASSERT_OFFSET(struct Renderer, signals, 0x10a0); -ASSERT_OFFSET(struct Renderer, signals_end, 0x10a8); -ASSERT_OFFSET(struct Renderer, queue_mutex, 0x1520); +ASSERT_OFFSET(struct Renderer, signals, 0x1100); +ASSERT_OFFSET(struct Renderer, signals_end, 0x1108); +ASSERT_OFFSET(struct Renderer, queue_mutex, 0x15c8); void wait_for_input( struct Renderer *renderer, struct Texture *texture, uint32_t target_queue @@ -82,7 +82,7 @@ void wait_for_input( pthread_mutex_unlock(&renderer->queue_mutex); } -// This hooks in via a function @ 0x431380 (method of CVulkanVRRenderer) which +// This hooks in via a function @ 0x434d30 (method of CVulkanVRRenderer) which // is a called to "prepare" an image for use by the GPU. It changes its layout // and queue if needed. The important part is that it gets called for images a // shader is about to read which are the problematic cases which cause stutters. |
