Refactor QuestSurface and Build-Quest scripts for improved surface handling and performance logging

This commit is contained in:
iChris4 committed 2026-09-16 22:30:05 +02:00
1 parent e52227baf5
commit 75f0f5f26d
4 files changed
+87 -9

No files matched your search

+4 -2
View File
@@ -57,9 +57,11 @@ if (-not $CMakeDir -or -not (Test-Path (Join-Path $CMakeDir 'bin\cmake.exe'))) {
}
$sdkCMake = Get-ChildItem -Path (Join-Path $sdkRoot 'cmake') -Directory | Sort-Object Name -Descending | Select-Object -First 1
if ($sdkCMake) { $env:PATH = (Join-Path $sdkCMake.FullName 'bin') + ';' + $env:PATH }
# Parenthesised: PowerShell's comma binds tighter than +, which would join both
# properties into a single line.
$localProperties = @(
'sdk.dir=' + $sdkRoot.Replace('\', '\\'),
'cmake.dir=' + $CMakeDir.Replace('\', '\\')
('sdk.dir=' + $sdkRoot.Replace('\', '\\')),
('cmake.dir=' + $CMakeDir.Replace('\', '\\'))
)
Set-Content -Path (Join-Path $root 'local.properties') -Value $localProperties -Encoding ascii
@@ -12,9 +12,21 @@ import org.libsdl.app.SDLSurface
* activity mutex internal to libSDL3.so, so this subclass brackets SDL's
* handling instead: begin takes Aurora's surface lock and pauses presentation,
* end releases it and reports whether SDL left the surface ready.
*
* The surface buffer is also pinned to [BUFFER_WIDTH] x [BUFFER_HEIGHT]. An
* immersive app's Android surface is never shown in the headset, yet SDL sizes
* it to the whole display (4128x2208 on a Quest 3). Aurora sizes its
* presentation snapshot from it, and in menus that snapshot is the image the
* virtual screen shows in each eye. The screen spans about 900 eye pixels at
* the default HUD size, so 1280x720 keeps menus sharp at a small fraction of
* the cost.
*/
class QuestSurface(context: Context) : SDLSurface(context) {
init {
holder.setFixedSize(BUFFER_WIDTH, BUFFER_HEIGHT)
}
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
nativeBeginSurfaceMutation()
try {
@@ -35,4 +47,9 @@ class QuestSurface(context: Context) : SDLSurface(context) {
private external fun nativeBeginSurfaceMutation()
private external fun nativeEndSurfaceMutation(ready: Boolean)
private companion object {
const val BUFFER_WIDTH = 1280
const val BUFFER_HEIGHT = 720
}
}