Merge "servicemanager: set consistent flags for self-reg" into main
diff --git a/cmds/installd/tests/fuzzers/InstalldServiceFuzzer.cpp b/cmds/installd/tests/fuzzers/InstalldServiceFuzzer.cpp
index b1c6940..50ea0c7 100644
--- a/cmds/installd/tests/fuzzers/InstalldServiceFuzzer.cpp
+++ b/cmds/installd/tests/fuzzers/InstalldServiceFuzzer.cpp
@@ -47,6 +47,8 @@
} // namespace android
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ // TODO(b/183141167): need to rewrite 'dump' to avoid SIGPIPE.
+ signal(SIGPIPE, SIG_IGN);
auto service = sp<InstalldNativeService>::make();
fuzzService(service, FuzzedDataProvider(data, size));
return 0;
diff --git a/libs/binder/BackendUnifiedServiceManager.cpp b/libs/binder/BackendUnifiedServiceManager.cpp
index 03d687a..34d5a09 100644
--- a/libs/binder/BackendUnifiedServiceManager.cpp
+++ b/libs/binder/BackendUnifiedServiceManager.cpp
@@ -132,6 +132,7 @@
serviceName.c_str());
return false;
}
+ if (kRemoveStaticList) return true;
for (const char* name : kStaticCachableList) {
if (name == serviceName) {
return true;
@@ -175,7 +176,7 @@
"isBinderAlive_false");
}
// If we reach here with kRemoveStaticList=true then we know service isn't lazy
- else if (kRemoveStaticList || mCacheForGetService->isClientSideCachingEnabled(serviceName)) {
+ else if (mCacheForGetService->isClientSideCachingEnabled(serviceName)) {
binder::ScopedTrace aidlTrace(ATRACE_TAG_AIDL,
"BinderCacheWithInvalidation::updateCache successful");
return mCacheForGetService->setItem(serviceName, binder);
diff --git a/libs/binder/include/binder/IInterface.h b/libs/binder/include/binder/IInterface.h
index 30e005c..5924a2d 100644
--- a/libs/binder/include/binder/IInterface.h
+++ b/libs/binder/include/binder/IInterface.h
@@ -220,8 +220,6 @@
"android.app.IActivityManager",
"android.app.IUidObserver",
"android.drm.IDrm",
- "android.dvr.IVsyncCallback",
- "android.dvr.IVsyncService",
"android.gfx.tests.ICallback",
"android.gfx.tests.IIPCTest",
"android.gfx.tests.ISafeInterfaceTest",
@@ -264,17 +262,12 @@
"android.media.IResourceManagerService",
"android.os.IComplexTypeInterface",
"android.os.IPermissionController",
- "android.os.IPingResponder",
"android.os.IProcessInfoService",
"android.os.ISchedulingPolicyService",
- "android.os.IStringConstants",
"android.os.storage.IObbActionListener",
"android.os.storage.IStorageEventListener",
"android.os.storage.IStorageManager",
"android.os.storage.IStorageShutdownObserver",
- "android.service.vr.IPersistentVrStateCallbacks",
- "android.service.vr.IVrManager",
- "android.service.vr.IVrStateCallbacks",
"android.ui.ISurfaceComposer",
"android.utils.IMemory",
"android.utils.IMemoryHeap",
@@ -286,9 +279,6 @@
"com.android.internal.os.IShellCallback",
"drm.IDrmManagerService",
"drm.IDrmServiceListener",
- "IAAudioClient",
- "IAAudioService",
- "VtsFuzzer",
nullptr,
};
diff --git a/libs/binder/tests/binderLibTest.cpp b/libs/binder/tests/binderLibTest.cpp
index 9e92f95..08fa03c 100644
--- a/libs/binder/tests/binderLibTest.cpp
+++ b/libs/binder/tests/binderLibTest.cpp
@@ -43,6 +43,7 @@
#include <input/BlockingQueue.h>
#include <processgroup/processgroup.h>
#include <utils/Flattenable.h>
+#include <utils/SystemClock.h>
#include <linux/sched.h>
#include <sys/epoll.h>
@@ -1837,14 +1838,6 @@
EXPECT_TRUE(reply.readBool());
}
-size_t epochMillis() {
- using std::chrono::duration_cast;
- using std::chrono::milliseconds;
- using std::chrono::seconds;
- using std::chrono::system_clock;
- return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
-}
-
TEST_F(BinderLibTest, HangingServices) {
Parcel data, reply;
sp<IBinder> server = addServer();
@@ -1853,7 +1846,7 @@
data.writeInt32(delay);
// b/266537959 - must take before taking lock, since countdown is started in the remote
// process there.
- size_t epochMsBefore = epochMillis();
+ int64_t timeBefore = uptimeMillis();
EXPECT_THAT(server->transact(BINDER_LIB_TEST_PROCESS_TEMPORARY_LOCK, data, &reply), NO_ERROR);
std::vector<std::thread> ts;
for (size_t i = 0; i < kKernelThreads + 1; i++) {
@@ -1867,10 +1860,10 @@
for (auto &t : ts) {
t.join();
}
- size_t epochMsAfter = epochMillis();
+ int64_t timeAfter = uptimeMillis();
// deadlock occurred and threads only finished after 1s passed.
- EXPECT_GE(epochMsAfter, epochMsBefore + delay);
+ EXPECT_GE(timeAfter, timeBefore + delay);
}
TEST_F(BinderLibTest, BinderProxyCount) {
diff --git a/libs/nativewindow/AHardwareBuffer.cpp b/libs/nativewindow/AHardwareBuffer.cpp
index ca41346..3205c32 100644
--- a/libs/nativewindow/AHardwareBuffer.cpp
+++ b/libs/nativewindow/AHardwareBuffer.cpp
@@ -112,6 +112,10 @@
static_cast<int>(aidl::android::hardware::graphics::common::PixelFormat::RGBA_10101010) ==
AHARDWAREBUFFER_FORMAT_R10G10B10A10_UNORM,
"HAL and AHardwareBuffer pixel format don't match");
+static_assert(
+ static_cast<int>(aidl::android::hardware::graphics::common::PixelFormat::YCBCR_P210) ==
+ AHARDWAREBUFFER_FORMAT_YCbCr_P210,
+ "HAL and AHardwareBuffer pixel format don't match");
static enum AHardwareBufferStatus filterStatus(status_t status) {
switch (status) {
@@ -300,8 +304,10 @@
if (result == 0) {
outPlanes->planeCount = 3;
outPlanes->planes[0].data = yuvData.y;
- // P010 is word-aligned 10-bit semiplaner, and YCbCr_422_I is a single interleaved plane
+ // P010 & P210 are word-aligned 10-bit semiplaner, and YCbCr_422_I is a single interleaved
+ // plane
if (format == AHARDWAREBUFFER_FORMAT_YCbCr_P010 ||
+ format == AHARDWAREBUFFER_FORMAT_YCbCr_P210 ||
format == AHARDWAREBUFFER_FORMAT_YCbCr_422_I) {
outPlanes->planes[0].pixelStride = 2;
} else {
@@ -724,6 +730,7 @@
case AHARDWAREBUFFER_FORMAT_YCrCb_420_SP:
case AHARDWAREBUFFER_FORMAT_YCbCr_422_I:
case AHARDWAREBUFFER_FORMAT_YCbCr_P010:
+ case AHARDWAREBUFFER_FORMAT_YCbCr_P210:
return true;
default:
return false;
diff --git a/libs/ui/include/ui/PublicFormat.h b/libs/ui/include/ui/PublicFormat.h
index e87931e..7c17763 100644
--- a/libs/ui/include/ui/PublicFormat.h
+++ b/libs/ui/include/ui/PublicFormat.h
@@ -60,6 +60,7 @@
JPEG_R = 0x1005,
HEIC = 0x48454946,
HEIC_ULTRAHDR = 0x1006,
+ YCBCR_P210 = 0x3c,
};
/* Convert from android.graphics.ImageFormat/PixelFormat enums to graphics.h HAL
diff --git a/services/surfaceflinger/Scheduler/Scheduler.h b/services/surfaceflinger/Scheduler/Scheduler.h
index 3fdddac..a2cdd46 100644
--- a/services/surfaceflinger/Scheduler/Scheduler.h
+++ b/services/surfaceflinger/Scheduler/Scheduler.h
@@ -209,6 +209,7 @@
ftl::FakeGuard guard(kMainThreadContext);
resyncToHardwareVsyncLocked(id, allowToEnable, modePtr);
}
+ void resync() override EXCLUDES(mDisplayLock);
void forceNextResync() { mLastResyncTime = 0; }
// Passes a vsync sample to VsyncController. Returns true if
@@ -470,7 +471,6 @@
bool throttleVsync(TimePoint, uid_t) override;
// Get frame interval
Period getVsyncPeriod(uid_t) override EXCLUDES(mDisplayLock);
- void resync() override EXCLUDES(mDisplayLock);
void onExpectedPresentTimePosted(TimePoint expectedPresentTime) override EXCLUDES(mDisplayLock);
std::unique_ptr<EventThread> mRenderEventThread;
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 59b1917..d7d567c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -877,6 +877,9 @@
} else if (algorithm == "kawase2") {
return renderengine::RenderEngine::BlurAlgorithm::KAWASE_DUAL_FILTER;
} else {
+ if (FlagManager::getInstance().window_blur_kawase2()) {
+ return renderengine::RenderEngine::BlurAlgorithm::KAWASE_DUAL_FILTER;
+ }
return renderengine::RenderEngine::BlurAlgorithm::KAWASE;
}
}
@@ -4563,6 +4566,7 @@
SFTRACE_INT("mTransactionFlags", transactionFlags);
if (const bool scheduled = transactionFlags & mask; !scheduled) {
+ mScheduler->resync();
scheduleCommit(frameHint);
} else if (frameHint == FrameHint::kActive) {
// Even if the next frame is already scheduled, we should reset the idle timer
diff --git a/services/surfaceflinger/common/FlagManager.cpp b/services/surfaceflinger/common/FlagManager.cpp
index 858f759..5e78426 100644
--- a/services/surfaceflinger/common/FlagManager.cpp
+++ b/services/surfaceflinger/common/FlagManager.cpp
@@ -165,6 +165,7 @@
DUMP_ACONFIG_FLAG(deprecate_frame_tracker);
DUMP_ACONFIG_FLAG(skip_invisible_windows_in_input);
DUMP_ACONFIG_FLAG(begone_bright_hlg);
+ DUMP_ACONFIG_FLAG(window_blur_kawase2);
#undef DUMP_ACONFIG_FLAG
#undef DUMP_LEGACY_SERVER_FLAG
@@ -264,6 +265,7 @@
FLAG_MANAGER_ACONFIG_FLAG(deprecate_frame_tracker, "");
FLAG_MANAGER_ACONFIG_FLAG(skip_invisible_windows_in_input, "");
FLAG_MANAGER_ACONFIG_FLAG(begone_bright_hlg, "debug.sf.begone_bright_hlg");
+FLAG_MANAGER_ACONFIG_FLAG(window_blur_kawase2, "");
/// Trunk stable server (R/W) flags ///
FLAG_MANAGER_ACONFIG_FLAG(refresh_rate_overlay_on_external_display, "")
diff --git a/services/surfaceflinger/common/include/common/FlagManager.h b/services/surfaceflinger/common/include/common/FlagManager.h
index 05af721..d8887f5 100644
--- a/services/surfaceflinger/common/include/common/FlagManager.h
+++ b/services/surfaceflinger/common/include/common/FlagManager.h
@@ -103,6 +103,7 @@
bool skip_invisible_windows_in_input() const;
bool begone_bright_hlg() const;
bool luts_api() const;
+ bool window_blur_kawase2() const;
protected:
// overridden for unit tests
diff --git a/services/surfaceflinger/surfaceflinger_flags_new.aconfig b/services/surfaceflinger/surfaceflinger_flags_new.aconfig
index fc0fabd..bdd826d 100644
--- a/services/surfaceflinger/surfaceflinger_flags_new.aconfig
+++ b/services/surfaceflinger/surfaceflinger_flags_new.aconfig
@@ -295,4 +295,11 @@
}
} # vrr_bugfix_dropped_frame
+flag {
+ name: "window_blur_kawase2"
+ namespace: "core_graphics"
+ description: "Flag for using Kawase2 algorithm for window blur"
+ bug: "353826438"
+} # window_blur_kawase2
+
# IMPORTANT - please keep alphabetize to reduce merge conflicts
diff --git a/vulkan/vkjson/vkjson.cc b/vulkan/vkjson/vkjson.cc
index 9b508aa..3cb9405 100644
--- a/vulkan/vkjson/vkjson.cc
+++ b/vulkan/vkjson/vkjson.cc
@@ -400,6 +400,78 @@
}
};
+template <>
+struct EnumTraits<VkPipelineRobustnessBufferBehavior> {
+ static bool exist(uint32_t e) {
+ switch (e) {
+ case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT:
+ case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED:
+ case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS:
+ case VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2:
+ return true;
+ }
+ return false;
+ }
+};
+
+template <>
+struct EnumTraits<VkPipelineRobustnessImageBehavior> {
+ static bool exist(uint32_t e) {
+ switch (e) {
+ case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT:
+ case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED:
+ case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS:
+ case VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2:
+ return true;
+ }
+ return false;
+ }
+};
+
+template <>
+struct EnumTraits<VkImageLayout> {
+ static bool exist(uint32_t e) {
+ switch (e) {
+ case VK_IMAGE_LAYOUT_UNDEFINED:
+ case VK_IMAGE_LAYOUT_GENERAL:
+ case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
+ case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
+ case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL:
+ case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL:
+ case VK_IMAGE_LAYOUT_PREINITIALIZED:
+ case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL:
+ case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL:
+ case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL:
+ case VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
+ case VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL:
+ case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR:
+ case VK_IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR:
+ case VK_IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR:
+ case VK_IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR:
+ case VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR:
+ case VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT:
+ case VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR:
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR:
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR:
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ case VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR:
+#endif
+ case VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT:
+ return true;
+ }
+ return false;
+ }
+};
+
// VkSparseImageFormatProperties
template <typename Visitor>
@@ -810,6 +882,68 @@
visitor->Visit("shaderIntegerDotProduct", &features->shaderIntegerDotProduct) &&
visitor->Visit("maintenance4", &features->maintenance4);
}
+
+template <typename Visitor>
+inline bool Iterate(Visitor* visitor, VkJsonCore14* core) {
+ return
+ visitor->Visit("features", &core->features) &&
+ visitor->Visit("properties", &core->properties);
+}
+
+template <typename Visitor>
+inline bool Iterate(Visitor* visitor, VkPhysicalDeviceVulkan14Properties* properties) {
+ return
+ visitor->Visit("lineSubPixelPrecisionBits", &properties->lineSubPixelPrecisionBits) &&
+ visitor->Visit("maxVertexAttribDivisor", &properties->maxVertexAttribDivisor) &&
+ visitor->Visit("supportsNonZeroFirstInstance", &properties->supportsNonZeroFirstInstance) &&
+ visitor->Visit("maxPushDescriptors", &properties->maxPushDescriptors) &&
+ visitor->Visit("dynamicRenderingLocalReadDepthStencilAttachments", &properties->dynamicRenderingLocalReadDepthStencilAttachments) &&
+ visitor->Visit("dynamicRenderingLocalReadMultisampledAttachments", &properties->dynamicRenderingLocalReadMultisampledAttachments) &&
+ visitor->Visit("earlyFragmentMultisampleCoverageAfterSampleCounting", &properties->earlyFragmentMultisampleCoverageAfterSampleCounting) &&
+ visitor->Visit("earlyFragmentSampleMaskTestBeforeSampleCounting", &properties->earlyFragmentSampleMaskTestBeforeSampleCounting) &&
+ visitor->Visit("depthStencilSwizzleOneSupport", &properties->depthStencilSwizzleOneSupport) &&
+ visitor->Visit("polygonModePointSize", &properties->polygonModePointSize) &&
+ visitor->Visit("nonStrictSinglePixelWideLinesUseParallelogram", &properties->nonStrictSinglePixelWideLinesUseParallelogram) &&
+ visitor->Visit("nonStrictWideLinesUseParallelogram", &properties->nonStrictWideLinesUseParallelogram) &&
+ visitor->Visit("blockTexelViewCompatibleMultipleLayers", &properties->blockTexelViewCompatibleMultipleLayers) &&
+ visitor->Visit("maxCombinedImageSamplerDescriptorCount", &properties->maxCombinedImageSamplerDescriptorCount) &&
+ visitor->Visit("fragmentShadingRateClampCombinerInputs", &properties->fragmentShadingRateClampCombinerInputs) &&
+ visitor->Visit("defaultRobustnessStorageBuffers", &properties->defaultRobustnessStorageBuffers) &&
+ visitor->Visit("defaultRobustnessUniformBuffers", &properties->defaultRobustnessUniformBuffers) &&
+ visitor->Visit("defaultRobustnessVertexInputs", &properties->defaultRobustnessVertexInputs) &&
+ visitor->Visit("defaultRobustnessImages", &properties->defaultRobustnessImages) &&
+ visitor->Visit("copySrcLayoutCount", &properties->copySrcLayoutCount) &&
+ visitor->VisitArray("pCopySrcLayouts", properties->copySrcLayoutCount, &properties->pCopySrcLayouts) &&
+ visitor->Visit("copyDstLayoutCount", &properties->copyDstLayoutCount) &&
+ visitor->VisitArray("pCopyDstLayouts", properties->copyDstLayoutCount, &properties->pCopyDstLayouts) &&
+ visitor->Visit("optimalTilingLayoutUUID", &properties->optimalTilingLayoutUUID) &&
+ visitor->Visit("identicalMemoryTypeRequirements", &properties->identicalMemoryTypeRequirements);
+}
+
+template <typename Visitor>
+inline bool Iterate(Visitor* visitor, VkPhysicalDeviceVulkan14Features* features) {
+ return
+ visitor->Visit("globalPriorityQuery", &features->globalPriorityQuery) &&
+ visitor->Visit("shaderSubgroupRotate", &features->shaderSubgroupRotate) &&
+ visitor->Visit("shaderSubgroupRotateClustered", &features->shaderSubgroupRotateClustered) &&
+ visitor->Visit("shaderFloatControls2", &features->shaderFloatControls2) &&
+ visitor->Visit("shaderExpectAssume", &features->shaderExpectAssume) &&
+ visitor->Visit("rectangularLines", &features->rectangularLines) &&
+ visitor->Visit("bresenhamLines", &features->bresenhamLines) &&
+ visitor->Visit("smoothLines", &features->smoothLines) &&
+ visitor->Visit("stippledRectangularLines", &features->stippledRectangularLines) &&
+ visitor->Visit("stippledBresenhamLines", &features->stippledBresenhamLines) &&
+ visitor->Visit("stippledSmoothLines", &features->stippledSmoothLines) &&
+ visitor->Visit("vertexAttributeInstanceRateDivisor", &features->vertexAttributeInstanceRateDivisor) &&
+ visitor->Visit("vertexAttributeInstanceRateZeroDivisor", &features->vertexAttributeInstanceRateZeroDivisor) &&
+ visitor->Visit("indexTypeUint8", &features->indexTypeUint8) &&
+ visitor->Visit("dynamicRenderingLocalRead", &features->dynamicRenderingLocalRead) &&
+ visitor->Visit("maintenance5", &features->maintenance5) &&
+ visitor->Visit("maintenance6", &features->maintenance6) &&
+ visitor->Visit("pipelineProtectedAccess", &features->pipelineProtectedAccess) &&
+ visitor->Visit("pipelineRobustness", &features->pipelineRobustness) &&
+ visitor->Visit("hostImageCopy", &features->hostImageCopy);
+}
// clang-format on
template <typename Visitor>
@@ -1051,7 +1185,7 @@
switch (device->properties.apiVersion ^
VK_API_VERSION_PATCH(device->properties.apiVersion)) {
case VK_API_VERSION_1_4:
- // TODO: real 1.4 support here
+ ret &= visitor->Visit("core14", &device->core14);
FALLTHROUGH_INTENDED;
case VK_API_VERSION_1_3:
ret &= visitor->Visit("core13", &device->core13);
@@ -1224,6 +1358,12 @@
return true;
}
+ template <typename T>
+ bool VisitArray(const char* key, uint32_t count, const T *value) {
+ object_[key] = ArrayToJsonValue(count, *value);
+ return true;
+ }
+
Json::Value get_object() const { return object_; }
private:
@@ -1288,6 +1428,15 @@
return true;
}
+inline bool AsValue(Json::Value* json_value, VkImageLayout* t) {
+ uint32_t value = 0;
+ if (!AsValue(json_value, &value))
+ return false;
+ if (!EnumTraits<VkImageLayout>::exist(value)) return false;
+ *t = static_cast<VkImageLayout>(value);
+ return true;
+}
+
template <typename T>
inline bool AsArray(Json::Value* json_value, uint32_t count, T* values) {
if (json_value->type() != Json::arrayValue || json_value->size() != count)
@@ -1398,6 +1547,20 @@
return false;
}
+ template <typename T>
+ bool VisitArray(const char* key, uint32_t count, T *value) {
+ Json::Value json_value = (*object_)[key];
+ if (!json_value) {
+ if (errors_)
+ *errors_ = std::string(key) + " missing.";
+ return false;
+ }
+ if (AsArray(&json_value, count, *value)) return true;
+ if (errors_)
+ *errors_ = std::string("Wrong type for ") + std::string(key) + ".";
+ return false;
+ }
+
private:
Json::Value* object_;
diff --git a/vulkan/vkjson/vkjson.h b/vulkan/vkjson/vkjson.h
index 88f6e7d..28de680 100644
--- a/vulkan/vkjson/vkjson.h
+++ b/vulkan/vkjson/vkjson.h
@@ -84,6 +84,11 @@
VkPhysicalDeviceVulkan13Features features;
};
+struct VkJsonCore14 {
+ VkPhysicalDeviceVulkan14Properties properties;
+ VkPhysicalDeviceVulkan14Features features;
+};
+
struct VkJsonDevice {
VkJsonDevice() {
memset(&properties, 0, sizeof(VkPhysicalDeviceProperties));
@@ -110,6 +115,7 @@
sizeof(VkPhysicalDeviceShaderDrawParameterFeatures));
memset(&core12, 0, sizeof(VkJsonCore12));
memset(&core13, 0, sizeof(VkJsonCore13));
+ memset(&core14, 0, sizeof(VkJsonCore14));
}
VkPhysicalDeviceProperties properties;
VkPhysicalDeviceFeatures features;
@@ -139,6 +145,7 @@
external_semaphore_properties;
VkJsonCore12 core12;
VkJsonCore13 core13;
+ VkJsonCore14 core14;
};
struct VkJsonDeviceGroup {
diff --git a/vulkan/vkjson/vkjson_instance.cc b/vulkan/vkjson/vkjson_instance.cc
index 0ffe7e0..32bc50b 100644
--- a/vulkan/vkjson/vkjson_instance.cc
+++ b/vulkan/vkjson/vkjson_instance.cc
@@ -292,6 +292,22 @@
vkGetPhysicalDeviceFeatures2(physical_device, &features);
}
+ if (device.properties.apiVersion >= VK_API_VERSION_1_4) {
+ device.core14.properties.sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_PROPERTIES;
+ device.core14.properties.pNext = properties.pNext;
+ properties.pNext = &device.core14.properties;
+
+ vkGetPhysicalDeviceProperties2(physical_device, &properties);
+
+ device.core14.features.sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES;
+ device.core14.features.pNext = features.pNext;
+ features.pNext = &device.core14.features;
+
+ vkGetPhysicalDeviceFeatures2(physical_device, &features);
+ }
+
return device;
}