mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 20:28:32 +09:00
[Fix, Test] (DirectVulkan, ShaderTranspiler, TraceReplay): derive NumSubgroups behind opt-in quirk
This commit is contained in:
@@ -164,6 +164,11 @@ bool LoadMobileGL(const Request& request, std::string& error) {
|
||||
} else {
|
||||
unsetenv("MOBILEGL_COHERENT_AS_FLUSH");
|
||||
}
|
||||
if (request.numSubgroupsQuirk) {
|
||||
setenv("MOBILEGL_NUM_SUBGROUPS_QUIRK", "1", 1);
|
||||
} else {
|
||||
unsetenv("MOBILEGL_NUM_SUBGROUPS_QUIRK");
|
||||
}
|
||||
if (request.fboAttachmentDumps.empty()) {
|
||||
unsetenv("MOBILEGL_TRACE_DUMP_FBO_ATTACHMENTS");
|
||||
} else {
|
||||
@@ -818,6 +823,7 @@ bool WriteResultJson(const Request& request, const Result& result) {
|
||||
<< (request.avoidAngleLlvmpipeSamplerMipmapMinFilter ? "true" : "false") << ",\n";
|
||||
file << " \"avoidAngleLlvmpipeExplicitLodBias\": "
|
||||
<< (request.avoidAngleLlvmpipeExplicitLodBias ? "true" : "false") << ",\n";
|
||||
file << " \"numSubgroupsQuirk\": " << (request.numSubgroupsQuirk ? "true" : "false") << ",\n";
|
||||
file << " \"holdMs\": " << request.holdMs << ",\n";
|
||||
file << " \"mismatchPixels\": " << result.mismatchPixels << "\n";
|
||||
file << "}\n";
|
||||
|
||||
@@ -44,6 +44,7 @@ struct Request {
|
||||
bool avoidAngleLlvmpipeSamplerMipmapMinFilter = false;
|
||||
bool avoidAngleLlvmpipeExplicitLodBias = false;
|
||||
bool coherentAsFlush = false;
|
||||
bool numSubgroupsQuirk = false;
|
||||
int holdMs = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
|
||||
jboolean avoidAngleLlvmpipeSamplerMipmapMinFilter,
|
||||
jboolean avoidAngleLlvmpipeExplicitLodBias,
|
||||
jboolean coherentAsFlush,
|
||||
jboolean numSubgroupsQuirk,
|
||||
jstring texture2dDumps) {
|
||||
mobilegl_trace::Request request;
|
||||
request.tracePath = ToString(env, tracePath);
|
||||
@@ -150,6 +151,7 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
|
||||
avoidAngleLlvmpipeSamplerMipmapMinFilter == JNI_TRUE;
|
||||
request.avoidAngleLlvmpipeExplicitLodBias = avoidAngleLlvmpipeExplicitLodBias == JNI_TRUE;
|
||||
request.coherentAsFlush = coherentAsFlush == JNI_TRUE;
|
||||
request.numSubgroupsQuirk = numSubgroupsQuirk == JNI_TRUE;
|
||||
|
||||
ScopedTraceReplayState replayState;
|
||||
mobilegl_trace_set_requested_size(request.width, request.height);
|
||||
|
||||
@@ -116,6 +116,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
request.avoidAngleLlvmpipeSamplerMipmapMinFilter,
|
||||
request.avoidAngleLlvmpipeExplicitLodBias,
|
||||
request.coherentAsFlush,
|
||||
request.numSubgroupsQuirk,
|
||||
request.texture2dDumps
|
||||
);
|
||||
Log.i(TAG, result.toString());
|
||||
@@ -149,6 +150,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
boolean avoidAngleLlvmpipeSamplerMipmapMinFilter,
|
||||
boolean avoidAngleLlvmpipeExplicitLodBias,
|
||||
boolean coherentAsFlush,
|
||||
boolean numSubgroupsQuirk,
|
||||
String texture2dDumps
|
||||
);
|
||||
|
||||
@@ -174,6 +176,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
final boolean avoidAngleLlvmpipeSamplerMipmapMinFilter;
|
||||
final boolean avoidAngleLlvmpipeExplicitLodBias;
|
||||
final boolean coherentAsFlush;
|
||||
final boolean numSubgroupsQuirk;
|
||||
final String texture2dDumps;
|
||||
|
||||
private TraceReplayRequest(
|
||||
@@ -198,6 +201,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
boolean avoidAngleLlvmpipeSamplerMipmapMinFilter,
|
||||
boolean avoidAngleLlvmpipeExplicitLodBias,
|
||||
boolean coherentAsFlush,
|
||||
boolean numSubgroupsQuirk,
|
||||
String texture2dDumps
|
||||
) {
|
||||
this.tracePath = tracePath;
|
||||
@@ -221,6 +225,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
this.avoidAngleLlvmpipeSamplerMipmapMinFilter = avoidAngleLlvmpipeSamplerMipmapMinFilter;
|
||||
this.avoidAngleLlvmpipeExplicitLodBias = avoidAngleLlvmpipeExplicitLodBias;
|
||||
this.coherentAsFlush = coherentAsFlush;
|
||||
this.numSubgroupsQuirk = numSubgroupsQuirk;
|
||||
this.texture2dDumps = texture2dDumps;
|
||||
}
|
||||
|
||||
@@ -249,6 +254,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
intent.getBooleanExtra("avoid_angle_llvmpipe_sampler_mipmap_min_filter", false),
|
||||
intent.getBooleanExtra("avoid_angle_llvmpipe_explicit_lod_bias", false),
|
||||
intent.getBooleanExtra("coherent_as_flush", false),
|
||||
intent.getBooleanExtra("num_subgroups_quirk", false),
|
||||
readString(intent, "texture_2d_dumps", "")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ Usage:
|
||||
[--avoid-angle-llvmpipe-sampler-mipmap-min-filter] \
|
||||
[--avoid-angle-llvmpipe-explicit-lod-bias] \
|
||||
[--coherent-as-flush] \
|
||||
[--num-subgroups-quirk] \
|
||||
[--dump-texture-2d CALL,TEXTURE,LEVEL,DIR] \
|
||||
--timeout-seconds N
|
||||
|
||||
@@ -47,6 +48,8 @@ sample with an explicit LOD that ANGLE llvmpipe cannot take a LOD bias on
|
||||
(MOBILEGL_AVOID_EXPLICIT_LOD_BIAS=1).
|
||||
Pass --coherent-as-flush for traces whose engine writes persistent
|
||||
GL_MAP_FLUSH_EXPLICIT_BIT maps it never flushes (MOBILEGL_COHERENT_AS_FLUSH=1).
|
||||
Pass --num-subgroups-quirk to derive compute gl_NumSubgroups instead of reading
|
||||
the Vulkan builtin (MOBILEGL_NUM_SUBGROUPS_QUIRK=1).
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -105,6 +108,7 @@ use_pbuffer=0
|
||||
avoid_angle_llvmpipe_sampler_mipmap_min_filter=0
|
||||
avoid_angle_llvmpipe_explicit_lod_bias=0
|
||||
coherent_as_flush=0
|
||||
num_subgroups_quirk=0
|
||||
texture_2d_dumps=""
|
||||
timeout_seconds=""
|
||||
|
||||
@@ -146,6 +150,7 @@ while [ "$#" -gt 0 ]; do
|
||||
shift 1
|
||||
;;
|
||||
--coherent-as-flush) coherent_as_flush=1; shift 1 ;;
|
||||
--num-subgroups-quirk) num_subgroups_quirk=1; shift 1 ;;
|
||||
--dump-texture-2d) texture_2d_dumps="$(next_arg "$@")"; shift 2 ;;
|
||||
--timeout-seconds) timeout_seconds="$(next_arg "$@")"; shift 2 ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
@@ -266,7 +271,7 @@ copy_app_artifact() {
|
||||
}
|
||||
|
||||
copy_texture_2d_dumps() {
|
||||
[ -n "${texture_2d_dumps}" ] || return
|
||||
[ -n "${texture_2d_dumps}" ] || return 0
|
||||
saved_ifs="${IFS}"
|
||||
IFS=';'
|
||||
set -- ${texture_2d_dumps}
|
||||
@@ -363,6 +368,9 @@ run_retrace() {
|
||||
if [ "${coherent_as_flush}" -eq 1 ]; then
|
||||
set -- "$@" --ez coherent_as_flush true
|
||||
fi
|
||||
if [ "${num_subgroups_quirk}" -eq 1 ]; then
|
||||
set -- "$@" --ez num_subgroups_quirk true
|
||||
fi
|
||||
if [ -n "${texture_2d_dumps}" ]; then
|
||||
set -- "$@" --es texture_2d_dumps "${texture_2d_dumps}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user