Unverified Commit 7208d3b7 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[Impeller] opt vulkan tests into GPU tracing. (#142649)

We're going to disable GPU tracing by default. Opt our benchmarks back in so that we have continuity.
parent 2652b9a3
...@@ -816,15 +816,7 @@ Future<void> _resetPlist(String testDirectory) async { ...@@ -816,15 +816,7 @@ Future<void> _resetPlist(String testDirectory) async {
await exec('git', <String>['checkout', file.path]); await exec('git', <String>['checkout', file.path]);
} }
/// Opens the file at testDirectory + 'android/app/src/main/AndroidManifest.xml' void _addMetadataToManifest(String testDirectory, List<(String, String)> keyPairs) {
/// and adds the following entry to the application.
/// <meta-data
/// android:name="io.flutter.embedding.android.ImpellerBackend"
/// android:value="opengles" />
/// <meta-data
/// android:name="io.flutter.embedding.android.EnableOpenGLGPUTracing"
/// android:value="true" />
void _addOpenGLESToManifest(String testDirectory) {
final String manifestPath = path.join( final String manifestPath = path.join(
testDirectory, 'android', 'app', 'src', 'main', 'AndroidManifest.xml'); testDirectory, 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
final File file = File(manifestPath); final File file = File(manifestPath);
...@@ -835,11 +827,6 @@ void _addOpenGLESToManifest(String testDirectory) { ...@@ -835,11 +827,6 @@ void _addOpenGLESToManifest(String testDirectory) {
final String xmlStr = file.readAsStringSync(); final String xmlStr = file.readAsStringSync();
final XmlDocument xmlDoc = XmlDocument.parse(xmlStr); final XmlDocument xmlDoc = XmlDocument.parse(xmlStr);
final List<(String, String)> keyPairs = <(String, String)>[
('io.flutter.embedding.android.ImpellerBackend', 'opengles'),
('io.flutter.embedding.android.EnableOpenGLGPUTracing', 'true')
];
final XmlElement applicationNode = final XmlElement applicationNode =
xmlDoc.findAllElements('application').first; xmlDoc.findAllElements('application').first;
...@@ -860,7 +847,6 @@ void _addOpenGLESToManifest(String testDirectory) { ...@@ -860,7 +847,6 @@ void _addOpenGLESToManifest(String testDirectory) {
XmlAttribute(XmlName('android:value'), value) XmlAttribute(XmlName('android:value'), value)
], ],
); );
applicationNode.children.add(metaData); applicationNode.children.add(metaData);
} }
} }
...@@ -868,6 +854,33 @@ void _addOpenGLESToManifest(String testDirectory) { ...@@ -868,6 +854,33 @@ void _addOpenGLESToManifest(String testDirectory) {
file.writeAsStringSync(xmlDoc.toXmlString(pretty: true, indent: ' ')); file.writeAsStringSync(xmlDoc.toXmlString(pretty: true, indent: ' '));
} }
/// Opens the file at testDirectory + 'android/app/src/main/AndroidManifest.xml'
/// <meta-data
/// android:name="io.flutter.embedding.android.EnableVulkanGPUTracing"
/// android:value="true" />
void _addVulkanGPUTracingToManifest(String testDirectory) {
final List<(String, String)> keyPairs = <(String, String)>[
('io.flutter.embedding.android.EnableVulkanGPUTracing', 'true'),
];
_addMetadataToManifest(testDirectory, keyPairs);
}
/// Opens the file at testDirectory + 'android/app/src/main/AndroidManifest.xml'
/// and adds the following entry to the application.
/// <meta-data
/// android:name="io.flutter.embedding.android.ImpellerBackend"
/// android:value="opengles" />
/// <meta-data
/// android:name="io.flutter.embedding.android.EnableOpenGLGPUTracing"
/// android:value="true" />
void _addOpenGLESToManifest(String testDirectory) {
final List<(String, String)> keyPairs = <(String, String)>[
('io.flutter.embedding.android.ImpellerBackend', 'opengles'),
('io.flutter.embedding.android.EnableOpenGLGPUTracing', 'true'),
];
_addMetadataToManifest(testDirectory, keyPairs);
}
Future<void> _resetManifest(String testDirectory) async { Future<void> _resetManifest(String testDirectory) async {
final String manifestPath = path.join( final String manifestPath = path.join(
testDirectory, 'android', 'app', 'src', 'main', 'AndroidManifest.xml'); testDirectory, 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
...@@ -1311,10 +1324,12 @@ class PerfTest { ...@@ -1311,10 +1324,12 @@ class PerfTest {
} }
try { try {
if (forceOpenGLES ?? false) { if (enableImpeller ?? false) {
assert(enableImpeller!);
changedManifest = true; changedManifest = true;
_addOpenGLESToManifest(testDirectory); _addVulkanGPUTracingToManifest(testDirectory);
if (forceOpenGLES ?? false) {
_addOpenGLESToManifest(testDirectory);
}
} }
if (disablePartialRepaint) { if (disablePartialRepaint) {
changedPlist = true; changedPlist = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment