Skip to content

Commit 2fc151d

Browse files
authored
Refactor dEQP level check and logging statements
1 parent 02ffd09 commit 2fc151d

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

  • trivialkart/trivialkart_unreal/Source/TrivialKart_Unreal

trivialkart/trivialkart_unreal/Source/TrivialKart_Unreal/DEQP_UPL.xml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@
1515
String testDeqpDate = "Unknown";
1616

1717
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);
18+
// 1. Check if target dEQP level (2024-03-01) is supported
19+
testSupportsModernVulkan = getPackageManager().hasSystemFeature("android.software.vulkan.deqp.level", 0x7e80301);
2020

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 && feature.name != null && feature.name.equals("android.software.vulkan.deqp.level")) {
26-
testDeqpLevel = feature.version;
27-
break;
28-
}
29-
}
30-
}
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 && "android.software.vulkan.deqp.level".equals(feature.name)) {
26+
testDeqpLevel = feature.version;
27+
break;
28+
}
29+
}
30+
}
3131

32-
// 3. Convert to YYYY-MM-DD format using bitwise operations (escaped for parser safety)
33-
if (testDeqpLevel > 0) {
34-
int year = (testDeqpLevel >> 16) & 0xFFFF;
35-
int month = (testDeqpLevel >> 8) & 0xFF;
36-
int day = testDeqpLevel & 0xFF;
37-
testDeqpDate = String.format("%04d-%02d-%02d", year, month, day);
38-
}
32+
// 3. Convert to YYYY-MM-DD format using bitwise operations (escaped for parser safety)
33+
if (testDeqpLevel > 0) {
34+
int year = (testDeqpLevel >> 16) & 0xFFFF;
35+
int month = (testDeqpLevel >> 8) & 0xFF;
36+
int day = testDeqpLevel & 0xFF;
37+
testDeqpDate = String.format(java.util.Locale.US, "%04d-%02d-%02d", year, month, day);
38+
}
3939

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", "==================================================");
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", "==================================================");
4949
} else {
50-
android.util.Log.w("UE_RHI_Selector", "Device API Level is below 24. Vulkan dEQP check skipped.");
50+
android.util.Log.w("UE_RHI_Selector", "Device API Level is below 24. Vulkan dEQP check skipped.");
5151
}
5252
// =================================================================
5353
</insert>
5454
</gameActivityOnCreateAdditions>
5555

56-
</root>
56+
</root>

0 commit comments

Comments
 (0)