Skip to content

Commit b802ef2

Browse files
authored
Merge pull request #117 from android/feature/vulkan-deqp-log
Add Vulkan dEQP level logging to TrivialKart Unreal sample
2 parents 7cee5f3 + 4faf259 commit b802ef2

2 files changed

Lines changed: 59 additions & 1 deletion

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<root xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<init>
5+
<log text="[DEQP_UPL] Initializing Pure Log Verification without CDATA..."/>
6+
</init>
7+
8+
<gameActivityOnCreateAdditions>
9+
<insert>
10+
// =================================================================
11+
// [DEQP SELECTOR LOG TEST] Pure log code without CommandLine variable
12+
// =================================================================
13+
boolean testSupportsModernVulkan = false;
14+
int testDeqpLevel = 0;
15+
String testDeqpDate = "Unknown";
16+
17+
if (android.os.Build.VERSION.SDK_INT >= 24) {
18+
// 1. Check if target dEQP level (2024-03-01) is supported
19+
testSupportsModernVulkan = getPackageManager().hasSystemFeature("android.software.vulkan.deqp.level", 0x7e80301);
20+
21+
// 2. Extract the actual dEQP level value from the device
22+
android.content.pm.FeatureInfo[] features = getPackageManager().getSystemAvailableFeatures();
23+
if (features != null) {
24+
for (android.content.pm.FeatureInfo feature : features) {
25+
if (feature != null &amp;&amp; "android.software.vulkan.deqp.level".equals(feature.name)) {
26+
testDeqpLevel = feature.version;
27+
break;
28+
}
29+
}
30+
}
31+
32+
// 3. Convert to YYYY-MM-DD format using bitwise operations (escaped for parser safety)
33+
if (testDeqpLevel > 0) {
34+
int year = (testDeqpLevel &gt;&gt; 16) &amp; 0xFFFF;
35+
int month = (testDeqpLevel &gt;&gt; 8) &amp; 0xFF;
36+
int day = testDeqpLevel &amp; 0xFF;
37+
testDeqpDate = String.format(java.util.Locale.US, "%04d-%02d-%02d", year, month, day);
38+
}
39+
40+
// [Log] Logcat output statement cleaned up with standard spacing
41+
android.util.Log.w("UE_RHI_Selector", "==================================================");
42+
android.util.Log.w("UE_RHI_Selector", "Device Model : " + android.os.Build.MODEL);
43+
android.util.Log.w("UE_RHI_Selector", "OS Version : Android " + android.os.Build.VERSION.RELEASE);
44+
android.util.Log.w("UE_RHI_Selector", "API Level : " + android.os.Build.VERSION.SDK_INT);
45+
android.util.Log.w("UE_RHI_Selector", "Device dEQP : 0x" + Integer.toHexString(testDeqpLevel) + " (" + testDeqpDate + ")");
46+
android.util.Log.w("UE_RHI_Selector", "Target dEQP : 0x7e80301 (2024-03-01)");
47+
android.util.Log.w("UE_RHI_Selector", "Modern Vulkan? : " + testSupportsModernVulkan);
48+
android.util.Log.w("UE_RHI_Selector", "==================================================");
49+
} else {
50+
android.util.Log.w("UE_RHI_Selector", "Device API Level is below 24. Vulkan dEQP check skipped.");
51+
}
52+
// =================================================================
53+
</insert>
54+
</gameActivityOnCreateAdditions>
55+
56+
</root>

trivialkart/trivialkart_unreal/Source/TrivialKart_Unreal/TrivialKart_Unreal.Build.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
using UnrealBuildTool;
19-
19+
using System.IO;
2020
public class TrivialKart_Unreal : ModuleRules
2121
{
2222
public TrivialKart_Unreal(ReadOnlyTargetRules Target) : base(Target)
@@ -45,6 +45,8 @@ public TrivialKart_Unreal(ReadOnlyTargetRules Target) : base(Target)
4545
if (Target.Platform == UnrealTargetPlatform.Android)
4646
{
4747
DynamicallyLoadedModuleNames.Add("OnlineSubsystemGooglePlay");
48+
string uplPath = Path.Combine(ModuleDirectory, "DEQP_UPL.xml");
49+
AdditionalPropertiesForReceipt.Add("AndroidPlugin", uplPath);
4850
}
4951
}
5052
}

0 commit comments

Comments
 (0)