mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 13:48:30 +09:00
[Fix] (trace-replay): stabilize ANGLE retrace cases
This commit is contained in:
@@ -78,12 +78,15 @@ jobs:
|
|||||||
- name: Download ANGLE x86_64 libraries
|
- name: Download ANGLE x86_64 libraries
|
||||||
run: |
|
run: |
|
||||||
angle_dir="android-plugin/app/src/trace/jniLibs/x86_64"
|
angle_dir="android-plugin/app/src/trace/jniLibs/x86_64"
|
||||||
angle_base="https://raw.githubusercontent.com/FCL-Team/FoldCraftLauncher/main/FCLauncher/src/main/jniLibs/x86_64"
|
angle_commit="f2a3d510dffd8f6540a52e1a7d0c5787d151075b"
|
||||||
|
angle_base="https://raw.githubusercontent.com/FCL-Team/FoldCraftLauncher/${angle_commit}/FCLauncher/src/main/jniLibs/x86_64"
|
||||||
mkdir -p "${angle_dir}"
|
mkdir -p "${angle_dir}"
|
||||||
curl -L --fail --retry 3 -o "${angle_dir}/libEGL_angle.so" "${angle_base}/libEGL_angle.so"
|
curl -L --fail --retry 3 -o "${angle_dir}/libEGL_angle.so" "${angle_base}/libEGL_angle.so"
|
||||||
curl -L --fail --retry 3 -o "${angle_dir}/libGLESv2_angle.so" "${angle_base}/libGLESv2_angle.so"
|
curl -L --fail --retry 3 -o "${angle_dir}/libGLESv2_angle.so" "${angle_base}/libGLESv2_angle.so"
|
||||||
test -s "${angle_dir}/libEGL_angle.so"
|
test -s "${angle_dir}/libEGL_angle.so"
|
||||||
test -s "${angle_dir}/libGLESv2_angle.so"
|
test -s "${angle_dir}/libGLESv2_angle.so"
|
||||||
|
echo "c41828768d089899fa058ec0bee711a91be88347f29bdb935223da6be1149c40 ${angle_dir}/libEGL_angle.so" | sha256sum -c -
|
||||||
|
echo "e4f820d99f94365c66df868c7740fef142fe5c0cd7c941790a9e30638857ca4d ${angle_dir}/libGLESv2_angle.so" | sha256sum -c -
|
||||||
|
|
||||||
- name: Build retrace APKs
|
- name: Build retrace APKs
|
||||||
run: gradle --no-daemon -p android-plugin :app:assembleEsprytTraceRelease :app:assembleMagmaTraceRelease -Pmobilegl.abis=all -Pmobilegl.debuggableRelease=true -Pmobilegl.logLevel=MOBILEGL_LOG_LEVEL_INFO --parallel --max-workers "$(nproc)"
|
run: gradle --no-daemon -p android-plugin :app:assembleEsprytTraceRelease :app:assembleMagmaTraceRelease -Pmobilegl.abis=all -Pmobilegl.debuggableRelease=true -Pmobilegl.logLevel=MOBILEGL_LOG_LEVEL_INFO --parallel --max-workers "$(nproc)"
|
||||||
@@ -322,6 +325,19 @@ jobs:
|
|||||||
MOBILEGL_VULKAN_R11G11B10F_FALLBACK: ${{ matrix.backend.name == 'DirectVulkan' && '1' || '0' }}
|
MOBILEGL_VULKAN_R11G11B10F_FALLBACK: ${{ matrix.backend.name == 'DirectVulkan' && '1' || '0' }}
|
||||||
run: |
|
run: |
|
||||||
apk_file="$(find android-retrace-apks -name '${{ matrix.backend.apk }}' -print -quit)"
|
apk_file="$(find android-retrace-apks -name '${{ matrix.backend.apk }}' -print -quit)"
|
||||||
|
extra_retrace_args=()
|
||||||
|
if [ "${{ matrix.backend.name }}" = "DirectGLES" ] && [ "${{ matrix.case.name }}" = "minecraft-1.21.4-fabric-iris-bliss-in-world" ]; then
|
||||||
|
angle_override_dir="${RUNNER_TEMP}/mobilegl-angle-bliss-x86_64"
|
||||||
|
angle_override_commit="bdcc96ac11c79001018ae4375eb73cb54a9f682f"
|
||||||
|
angle_override_base="https://raw.githubusercontent.com/FCL-Team/FoldCraftLauncher/${angle_override_commit}/FCLauncher/src/main/jniLibs/x86_64"
|
||||||
|
mkdir -p "${angle_override_dir}"
|
||||||
|
curl -L --fail --retry 3 -o "${angle_override_dir}/libEGL_angle.so" "${angle_override_base}/libEGL_angle.so"
|
||||||
|
curl -L --fail --retry 3 -o "${angle_override_dir}/libGLESv2_angle.so" "${angle_override_base}/libGLESv2_angle.so"
|
||||||
|
echo "d0f4298ccc770cc801fc52e21733521646161e8a4adb3bd0052d9a1b57ee0ca8 ${angle_override_dir}/libEGL_angle.so" | sha256sum -c -
|
||||||
|
echo "66fdc867e552192d553d59095ea2e3cef4829de65c356f1fd826027b1905972e ${angle_override_dir}/libGLESv2_angle.so" | sha256sum -c -
|
||||||
|
extra_retrace_args+=(--angle-library-dir "${angle_override_dir}")
|
||||||
|
extra_retrace_args+=(--avoid-angle-llvmpipe-sampler-mipmap-min-filter)
|
||||||
|
fi
|
||||||
timeout "$(( ${{ matrix.case.timeout_seconds }} + 300 ))" sh android-plugin/trace-replay-ci.sh \
|
timeout "$(( ${{ matrix.case.timeout_seconds }} + 300 ))" sh android-plugin/trace-replay-ci.sh \
|
||||||
--apk-file "${apk_file}" \
|
--apk-file "${apk_file}" \
|
||||||
--package "${{ matrix.backend.package }}" \
|
--package "${{ matrix.backend.package }}" \
|
||||||
@@ -341,7 +357,8 @@ jobs:
|
|||||||
--crop-y "${{ matrix.case.crop_y }}" \
|
--crop-y "${{ matrix.case.crop_y }}" \
|
||||||
--crop-width "${{ matrix.case.crop_width }}" \
|
--crop-width "${{ matrix.case.crop_width }}" \
|
||||||
--crop-height "${{ matrix.case.crop_height }}" \
|
--crop-height "${{ matrix.case.crop_height }}" \
|
||||||
--timeout-seconds "${{ matrix.case.timeout_seconds }}"
|
--timeout-seconds "${{ matrix.case.timeout_seconds }}" \
|
||||||
|
"${extra_retrace_args[@]}"
|
||||||
|
|
||||||
- name: Collect retrace summary inputs
|
- name: Collect retrace summary inputs
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -25,20 +25,28 @@
|
|||||||
#include <MG_State/GLState/FramebufferState/FramebufferObject.h>
|
#include <MG_State/GLState/FramebufferState/FramebufferObject.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace MobileGL::MG_Backend::DirectGLES {
|
namespace MobileGL::MG_Backend::DirectGLES {
|
||||||
constexpr Bool PREFER_MAP_BUFFER_RANGE_FOR_BUFFER_SYNC = false;
|
constexpr Bool PREFER_MAP_BUFFER_RANGE_FOR_BUFFER_SYNC = false;
|
||||||
constexpr const char* BASE_INSTANCE_UNIFORM_NAME = "mg_BaseInstance";
|
constexpr const char* BASE_INSTANCE_UNIFORM_NAME = "mg_BaseInstance";
|
||||||
|
|
||||||
static Bool ShouldAvoidMipmapMinFilterOnAngleLlvmpipe() {
|
static Bool IsAngleLlvmpipeRenderer() {
|
||||||
return g_GLESCapabilities.GLESRendererString.find("ANGLE") != String::npos &&
|
return g_GLESCapabilities.GLESRendererString.find("ANGLE") != String::npos &&
|
||||||
g_GLESCapabilities.GLESRendererString.find("llvmpipe") != String::npos;
|
g_GLESCapabilities.GLESRendererString.find("llvmpipe") != String::npos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLenum ResolveBackendMinFilter(const SamplerParameters& samplerParams) {
|
static Bool ShouldAvoidSamplerMipmapMinFilterOnAngleLlvmpipe() {
|
||||||
|
const char* value = std::getenv("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER");
|
||||||
|
return value != nullptr && std::strcmp(value, "1") == 0 && IsAngleLlvmpipeRenderer();
|
||||||
|
}
|
||||||
|
|
||||||
|
static GLenum ResolveBackendMinFilter(const SamplerParameters& samplerParams,
|
||||||
|
Bool avoidMipmapMinFilter) {
|
||||||
GLenum filter = MG_Util::ConvertSamplerFilterModeToGLEnum(samplerParams.minFilter,
|
GLenum filter = MG_Util::ConvertSamplerFilterModeToGLEnum(samplerParams.minFilter,
|
||||||
samplerParams.mipmapMode);
|
samplerParams.mipmapMode);
|
||||||
if (!ShouldAvoidMipmapMinFilterOnAngleLlvmpipe()) {
|
if (!avoidMipmapMinFilter) {
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
switch (filter) {
|
switch (filter) {
|
||||||
@@ -1214,7 +1222,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
if (m_cacheSamplerParameters.minFilter != samplerParams.minFilter ||
|
if (m_cacheSamplerParameters.minFilter != samplerParams.minFilter ||
|
||||||
m_cacheSamplerParameters.mipmapMode != samplerParams.mipmapMode) {
|
m_cacheSamplerParameters.mipmapMode != samplerParams.mipmapMode) {
|
||||||
g_GLESFuncs.glTexParameteri(target, GL_TEXTURE_MIN_FILTER,
|
g_GLESFuncs.glTexParameteri(target, GL_TEXTURE_MIN_FILTER,
|
||||||
(GLint)ResolveBackendMinFilter(samplerParams));
|
(GLint)ResolveBackendMinFilter(samplerParams, IsAngleLlvmpipeRenderer()));
|
||||||
m_cacheSamplerParameters.minFilter = samplerParams.minFilter;
|
m_cacheSamplerParameters.minFilter = samplerParams.minFilter;
|
||||||
m_cacheSamplerParameters.mipmapMode = samplerParams.mipmapMode;
|
m_cacheSamplerParameters.mipmapMode = samplerParams.mipmapMode;
|
||||||
}
|
}
|
||||||
@@ -1962,7 +1970,9 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
|||||||
if (m_cacheSamplerParameters.minFilter != samplerParams.minFilter ||
|
if (m_cacheSamplerParameters.minFilter != samplerParams.minFilter ||
|
||||||
m_cacheSamplerParameters.mipmapMode != samplerParams.mipmapMode) {
|
m_cacheSamplerParameters.mipmapMode != samplerParams.mipmapMode) {
|
||||||
g_GLESFuncs.glSamplerParameteri(m_backendSamplerId, GL_TEXTURE_MIN_FILTER,
|
g_GLESFuncs.glSamplerParameteri(m_backendSamplerId, GL_TEXTURE_MIN_FILTER,
|
||||||
(GLint)ResolveBackendMinFilter(samplerParams));
|
(GLint)ResolveBackendMinFilter(
|
||||||
|
samplerParams,
|
||||||
|
ShouldAvoidSamplerMipmapMinFilterOnAngleLlvmpipe()));
|
||||||
m_cacheSamplerParameters.minFilter = samplerParams.minFilter;
|
m_cacheSamplerParameters.minFilter = samplerParams.minFilter;
|
||||||
m_cacheSamplerParameters.mipmapMode = samplerParams.mipmapMode;
|
m_cacheSamplerParameters.mipmapMode = samplerParams.mipmapMode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,11 @@ bool LoadMobileGL(const Request& request, std::string& error) {
|
|||||||
unsetenv("MOBILEGL_RETRACE_USE_ANGLE");
|
unsetenv("MOBILEGL_RETRACE_USE_ANGLE");
|
||||||
unsetenv("MOBILEGL_RETRACE_ANGLE_DIR");
|
unsetenv("MOBILEGL_RETRACE_ANGLE_DIR");
|
||||||
}
|
}
|
||||||
|
if (request.avoidAngleLlvmpipeSamplerMipmapMinFilter) {
|
||||||
|
setenv("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER", "1", 1);
|
||||||
|
} else {
|
||||||
|
unsetenv("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER");
|
||||||
|
}
|
||||||
|
|
||||||
void* handle = dlopen(request.mobileGlLibrary.c_str(), RTLD_NOW | RTLD_GLOBAL);
|
void* handle = dlopen(request.mobileGlLibrary.c_str(), RTLD_NOW | RTLD_GLOBAL);
|
||||||
if (handle == nullptr) {
|
if (handle == nullptr) {
|
||||||
@@ -870,6 +875,8 @@ bool WriteResultJson(const Request& request, const Result& result) {
|
|||||||
file << " \"ssimThreshold\": " << request.ssimThreshold << ",\n";
|
file << " \"ssimThreshold\": " << request.ssimThreshold << ",\n";
|
||||||
file << " \"useAngle\": " << (UseAngleForRequest(request) ? "true" : "false") << ",\n";
|
file << " \"useAngle\": " << (UseAngleForRequest(request) ? "true" : "false") << ",\n";
|
||||||
file << " \"usePbuffer\": " << (request.usePbuffer ? "true" : "false") << ",\n";
|
file << " \"usePbuffer\": " << (request.usePbuffer ? "true" : "false") << ",\n";
|
||||||
|
file << " \"avoidAngleLlvmpipeSamplerMipmapMinFilter\": "
|
||||||
|
<< (request.avoidAngleLlvmpipeSamplerMipmapMinFilter ? "true" : "false") << ",\n";
|
||||||
file << " \"holdMs\": " << request.holdMs << ",\n";
|
file << " \"holdMs\": " << request.holdMs << ",\n";
|
||||||
file << " \"mismatchPixels\": " << result.mismatchPixels << "\n";
|
file << " \"mismatchPixels\": " << result.mismatchPixels << "\n";
|
||||||
file << "}\n";
|
file << "}\n";
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ struct Request {
|
|||||||
double ssimThreshold = 0.99;
|
double ssimThreshold = 0.99;
|
||||||
bool useAngle = false;
|
bool useAngle = false;
|
||||||
bool usePbuffer = true;
|
bool usePbuffer = true;
|
||||||
|
bool avoidAngleLlvmpipeSamplerMipmapMinFilter = false;
|
||||||
int holdMs = 0;
|
int holdMs = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
|
|||||||
jint cropHeight,
|
jint cropHeight,
|
||||||
jstring angleLibraryDir,
|
jstring angleLibraryDir,
|
||||||
jboolean useAngle,
|
jboolean useAngle,
|
||||||
jboolean usePbuffer) {
|
jboolean usePbuffer,
|
||||||
|
jboolean avoidAngleLlvmpipeSamplerMipmapMinFilter) {
|
||||||
mobilegl_trace::Request request;
|
mobilegl_trace::Request request;
|
||||||
request.tracePath = ToString(env, tracePath);
|
request.tracePath = ToString(env, tracePath);
|
||||||
request.goldenPath = ToString(env, goldenPath);
|
request.goldenPath = ToString(env, goldenPath);
|
||||||
@@ -123,6 +124,8 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
|
|||||||
request.cropHeight = cropHeight;
|
request.cropHeight = cropHeight;
|
||||||
request.useAngle = useAngle == JNI_TRUE;
|
request.useAngle = useAngle == JNI_TRUE;
|
||||||
request.usePbuffer = usePbuffer == JNI_TRUE;
|
request.usePbuffer = usePbuffer == JNI_TRUE;
|
||||||
|
request.avoidAngleLlvmpipeSamplerMipmapMinFilter =
|
||||||
|
avoidAngleLlvmpipeSamplerMipmapMinFilter == JNI_TRUE;
|
||||||
|
|
||||||
ScopedTraceReplayState replayState;
|
ScopedTraceReplayState replayState;
|
||||||
mobilegl_trace_set_requested_size(request.width, request.height);
|
mobilegl_trace_set_requested_size(request.width, request.height);
|
||||||
|
|||||||
+10
-4
@@ -113,7 +113,8 @@ public final class TraceReplayActivity extends Activity {
|
|||||||
request.cropHeight,
|
request.cropHeight,
|
||||||
request.angleLibraryDir,
|
request.angleLibraryDir,
|
||||||
request.useAngle,
|
request.useAngle,
|
||||||
request.usePbuffer
|
request.usePbuffer,
|
||||||
|
request.avoidAngleLlvmpipeSamplerMipmapMinFilter
|
||||||
);
|
);
|
||||||
Log.i(TAG, result.toString());
|
Log.i(TAG, result.toString());
|
||||||
TraceReplayResult finalResult = result;
|
TraceReplayResult finalResult = result;
|
||||||
@@ -142,7 +143,8 @@ public final class TraceReplayActivity extends Activity {
|
|||||||
int cropHeight,
|
int cropHeight,
|
||||||
String angleLibraryDir,
|
String angleLibraryDir,
|
||||||
boolean useAngle,
|
boolean useAngle,
|
||||||
boolean usePbuffer
|
boolean usePbuffer,
|
||||||
|
boolean avoidAngleLlvmpipeSamplerMipmapMinFilter
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final class TraceReplayRequest {
|
private static final class TraceReplayRequest {
|
||||||
@@ -164,6 +166,7 @@ public final class TraceReplayActivity extends Activity {
|
|||||||
final String angleLibraryDir;
|
final String angleLibraryDir;
|
||||||
final boolean useAngle;
|
final boolean useAngle;
|
||||||
final boolean usePbuffer;
|
final boolean usePbuffer;
|
||||||
|
final boolean avoidAngleLlvmpipeSamplerMipmapMinFilter;
|
||||||
|
|
||||||
private TraceReplayRequest(
|
private TraceReplayRequest(
|
||||||
String tracePath,
|
String tracePath,
|
||||||
@@ -183,7 +186,8 @@ public final class TraceReplayActivity extends Activity {
|
|||||||
int cropHeight,
|
int cropHeight,
|
||||||
String angleLibraryDir,
|
String angleLibraryDir,
|
||||||
boolean useAngle,
|
boolean useAngle,
|
||||||
boolean usePbuffer
|
boolean usePbuffer,
|
||||||
|
boolean avoidAngleLlvmpipeSamplerMipmapMinFilter
|
||||||
) {
|
) {
|
||||||
this.tracePath = tracePath;
|
this.tracePath = tracePath;
|
||||||
this.goldenPath = goldenPath;
|
this.goldenPath = goldenPath;
|
||||||
@@ -203,6 +207,7 @@ public final class TraceReplayActivity extends Activity {
|
|||||||
this.angleLibraryDir = angleLibraryDir;
|
this.angleLibraryDir = angleLibraryDir;
|
||||||
this.useAngle = useAngle;
|
this.useAngle = useAngle;
|
||||||
this.usePbuffer = usePbuffer;
|
this.usePbuffer = usePbuffer;
|
||||||
|
this.avoidAngleLlvmpipeSamplerMipmapMinFilter = avoidAngleLlvmpipeSamplerMipmapMinFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TraceReplayRequest from(Intent intent, File filesDir, String nativeLibraryDir, String defaultBackend) {
|
static TraceReplayRequest from(Intent intent, File filesDir, String nativeLibraryDir, String defaultBackend) {
|
||||||
@@ -226,7 +231,8 @@ public final class TraceReplayActivity extends Activity {
|
|||||||
intent.getIntExtra("crop_height", 0),
|
intent.getIntExtra("crop_height", 0),
|
||||||
readString(intent, "angle_library_dir", nativeLibraryDir),
|
readString(intent, "angle_library_dir", nativeLibraryDir),
|
||||||
intent.getBooleanExtra("use_angle", false),
|
intent.getBooleanExtra("use_angle", false),
|
||||||
intent.getBooleanExtra("use_pbuffer", false)
|
intent.getBooleanExtra("use_pbuffer", false),
|
||||||
|
intent.getBooleanExtra("avoid_angle_llvmpipe_sampler_mipmap_min_filter", false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Usage:
|
|||||||
--trace-file FILE_IN_ARCHIVE \
|
--trace-file FILE_IN_ARCHIVE \
|
||||||
--golden FILE \
|
--golden FILE \
|
||||||
[--alternate-golden FILE] \
|
[--alternate-golden FILE] \
|
||||||
|
[--angle-library-dir DIR] \
|
||||||
--target-call N \
|
--target-call N \
|
||||||
--width N \
|
--width N \
|
||||||
--height N \
|
--height N \
|
||||||
@@ -27,12 +28,15 @@ Usage:
|
|||||||
--crop-width N \
|
--crop-width N \
|
||||||
--crop-height N \
|
--crop-height N \
|
||||||
[--use-pbuffer] \
|
[--use-pbuffer] \
|
||||||
|
[--avoid-angle-llvmpipe-sampler-mipmap-min-filter] \
|
||||||
--timeout-seconds N
|
--timeout-seconds N
|
||||||
|
|
||||||
Set MOBILEGL_RETRACE_USE_ANGLE=1 to run DirectGLES replay with packaged ANGLE
|
Set MOBILEGL_RETRACE_USE_ANGLE=1 to run DirectGLES replay with packaged ANGLE
|
||||||
instead of the device system GLES driver.
|
instead of the device system GLES driver.
|
||||||
Set MOBILEGL_RETRACE_USE_PBUFFER=1 or pass --use-pbuffer to run DirectGLES
|
Set MOBILEGL_RETRACE_USE_PBUFFER=1 or pass --use-pbuffer to run DirectGLES
|
||||||
against an offscreen EGL pbuffer instead of the Activity surface.
|
against an offscreen EGL pbuffer instead of the Activity surface.
|
||||||
|
Pass --avoid-angle-llvmpipe-sampler-mipmap-min-filter for DirectGLES traces that
|
||||||
|
need ANGLE llvmpipe sampler mipmap filters downgraded to avoid driver stalls.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +83,7 @@ trace_archive=""
|
|||||||
trace_file=""
|
trace_file=""
|
||||||
golden_path=""
|
golden_path=""
|
||||||
alternate_golden_path=""
|
alternate_golden_path=""
|
||||||
|
angle_library_dir=""
|
||||||
target_call=""
|
target_call=""
|
||||||
width=""
|
width=""
|
||||||
height=""
|
height=""
|
||||||
@@ -88,6 +93,7 @@ crop_y=""
|
|||||||
crop_width=""
|
crop_width=""
|
||||||
crop_height=""
|
crop_height=""
|
||||||
use_pbuffer=0
|
use_pbuffer=0
|
||||||
|
avoid_angle_llvmpipe_sampler_mipmap_min_filter=0
|
||||||
timeout_seconds=""
|
timeout_seconds=""
|
||||||
|
|
||||||
while [ "$#" -gt 0 ]; do
|
while [ "$#" -gt 0 ]; do
|
||||||
@@ -110,6 +116,7 @@ while [ "$#" -gt 0 ]; do
|
|||||||
shift 2
|
shift 2
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
--angle-library-dir) angle_library_dir="$(next_arg "$@")"; shift 2 ;;
|
||||||
--target-call) target_call="$(next_arg "$@")"; shift 2 ;;
|
--target-call) target_call="$(next_arg "$@")"; shift 2 ;;
|
||||||
--width) width="$(next_arg "$@")"; shift 2 ;;
|
--width) width="$(next_arg "$@")"; shift 2 ;;
|
||||||
--height) height="$(next_arg "$@")"; shift 2 ;;
|
--height) height="$(next_arg "$@")"; shift 2 ;;
|
||||||
@@ -119,6 +126,10 @@ while [ "$#" -gt 0 ]; do
|
|||||||
--crop-width) crop_width="$(next_arg "$@")"; shift 2 ;;
|
--crop-width) crop_width="$(next_arg "$@")"; shift 2 ;;
|
||||||
--crop-height) crop_height="$(next_arg "$@")"; shift 2 ;;
|
--crop-height) crop_height="$(next_arg "$@")"; shift 2 ;;
|
||||||
--use-pbuffer) use_pbuffer=1; shift 1 ;;
|
--use-pbuffer) use_pbuffer=1; shift 1 ;;
|
||||||
|
--avoid-angle-llvmpipe-sampler-mipmap-min-filter)
|
||||||
|
avoid_angle_llvmpipe_sampler_mipmap_min_filter=1
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
--timeout-seconds) timeout_seconds="$(next_arg "$@")"; shift 2 ;;
|
--timeout-seconds) timeout_seconds="$(next_arg "$@")"; shift 2 ;;
|
||||||
-h|--help) usage; exit 0 ;;
|
-h|--help) usage; exit 0 ;;
|
||||||
*) die "unknown argument: $1" ;;
|
*) die "unknown argument: $1" ;;
|
||||||
@@ -150,6 +161,10 @@ test -f "${golden_path}" || die "golden image does not exist: ${golden_path}"
|
|||||||
if [ -n "${alternate_golden_path}" ]; then
|
if [ -n "${alternate_golden_path}" ]; then
|
||||||
test -f "${alternate_golden_path}" || die "alternate golden image does not exist: ${alternate_golden_path}"
|
test -f "${alternate_golden_path}" || die "alternate golden image does not exist: ${alternate_golden_path}"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${angle_library_dir}" ]; then
|
||||||
|
test -f "${angle_library_dir}/libEGL_angle.so" || die "ANGLE override is missing libEGL_angle.so: ${angle_library_dir}"
|
||||||
|
test -f "${angle_library_dir}/libGLESv2_angle.so" || die "ANGLE override is missing libGLESv2_angle.so: ${angle_library_dir}"
|
||||||
|
fi
|
||||||
|
|
||||||
safe_case="$(printf '%s' "${case_name}" | sed 's/[^A-Za-z0-9._-]/_/g')"
|
safe_case="$(printf '%s' "${case_name}" | sed 's/[^A-Za-z0-9._-]/_/g')"
|
||||||
app_dir="/data/user/0/${package_name}/files/trace-replay"
|
app_dir="/data/user/0/${package_name}/files/trace-replay"
|
||||||
@@ -188,10 +203,18 @@ prepare_fixture() {
|
|||||||
if [ -n "${alternate_golden_path}" ]; then
|
if [ -n "${alternate_golden_path}" ]; then
|
||||||
adb_device_path push "$(host_path_for_adb "${alternate_golden_path}")" "/data/local/tmp/mobilegl-${safe_case}.alternate-golden.png"
|
adb_device_path push "$(host_path_for_adb "${alternate_golden_path}")" "/data/local/tmp/mobilegl-${safe_case}.alternate-golden.png"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${angle_library_dir}" ]; then
|
||||||
|
adb_device_path push "$(host_path_for_adb "${angle_library_dir}/libEGL_angle.so")" "/data/local/tmp/mobilegl-${safe_case}.libEGL_angle.so"
|
||||||
|
adb_device_path push "$(host_path_for_adb "${angle_library_dir}/libGLESv2_angle.so")" "/data/local/tmp/mobilegl-${safe_case}.libGLESv2_angle.so"
|
||||||
|
fi
|
||||||
adb_device_path shell chmod 0644 "/data/local/tmp/mobilegl-${safe_case}.trace" "/data/local/tmp/mobilegl-${safe_case}.golden.png"
|
adb_device_path shell chmod 0644 "/data/local/tmp/mobilegl-${safe_case}.trace" "/data/local/tmp/mobilegl-${safe_case}.golden.png"
|
||||||
if [ -n "${alternate_golden_path}" ]; then
|
if [ -n "${alternate_golden_path}" ]; then
|
||||||
adb_device_path shell chmod 0644 "/data/local/tmp/mobilegl-${safe_case}.alternate-golden.png"
|
adb_device_path shell chmod 0644 "/data/local/tmp/mobilegl-${safe_case}.alternate-golden.png"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${angle_library_dir}" ]; then
|
||||||
|
adb_device_path shell chmod 0644 "/data/local/tmp/mobilegl-${safe_case}.libEGL_angle.so" \
|
||||||
|
"/data/local/tmp/mobilegl-${safe_case}.libGLESv2_angle.so"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
copy_fixture_to_app() {
|
copy_fixture_to_app() {
|
||||||
@@ -206,6 +229,13 @@ copy_fixture_to_app() {
|
|||||||
if [ -n "${alternate_golden_path}" ]; then
|
if [ -n "${alternate_golden_path}" ]; then
|
||||||
adb_device_path shell run-as "${package_name}" cp "${alternate_golden_tmp}" "${app_dir}/input/alternate-golden.png"
|
adb_device_path shell run-as "${package_name}" cp "${alternate_golden_tmp}" "${app_dir}/input/alternate-golden.png"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "${angle_library_dir}" ]; then
|
||||||
|
adb_device_path shell run-as "${package_name}" mkdir -p "${app_dir}/angle"
|
||||||
|
adb_device_path shell run-as "${package_name}" cp "/data/local/tmp/mobilegl-${safe_case}.libEGL_angle.so" \
|
||||||
|
"${app_dir}/angle/libEGL_angle.so"
|
||||||
|
adb_device_path shell run-as "${package_name}" cp "/data/local/tmp/mobilegl-${safe_case}.libGLESv2_angle.so" \
|
||||||
|
"${app_dir}/angle/libGLESv2_angle.so"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_retrace() {
|
run_retrace() {
|
||||||
@@ -236,10 +266,16 @@ run_retrace() {
|
|||||||
fi
|
fi
|
||||||
if [ "${use_angle}" -eq 1 ]; then
|
if [ "${use_angle}" -eq 1 ]; then
|
||||||
set -- "$@" --ez use_angle true
|
set -- "$@" --ez use_angle true
|
||||||
|
if [ -n "${angle_library_dir}" ]; then
|
||||||
|
set -- "$@" --es angle_library_dir "${app_dir}/angle"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "${use_pbuffer}" -eq 1 ] && [ "${backend}" = "DirectGLES" ]; then
|
if [ "${use_pbuffer}" -eq 1 ] && [ "${backend}" = "DirectGLES" ]; then
|
||||||
set -- "$@" --ez use_pbuffer true
|
set -- "$@" --ez use_pbuffer true
|
||||||
fi
|
fi
|
||||||
|
if [ "${avoid_angle_llvmpipe_sampler_mipmap_min_filter}" -eq 1 ] && [ "${backend}" = "DirectGLES" ]; then
|
||||||
|
set -- "$@" --ez avoid_angle_llvmpipe_sampler_mipmap_min_filter true
|
||||||
|
fi
|
||||||
set -- "$@" \
|
set -- "$@" \
|
||||||
--es output_dir "${app_dir}/output" \
|
--es output_dir "${app_dir}/output" \
|
||||||
--es diff_path "${app_dir}/output/${safe_case}-diff.png" \
|
--es diff_path "${app_dir}/output/${safe_case}-diff.png" \
|
||||||
|
|||||||
Reference in New Issue
Block a user