Merge "libbinder_ndk: prune AParcel_readStatusHeader ret"
diff --git a/cmds/installd/CacheItem.cpp b/cmds/installd/CacheItem.cpp
index 515f915..e29ff4c 100644
--- a/cmds/installd/CacheItem.cpp
+++ b/cmds/installd/CacheItem.cpp
@@ -73,7 +73,7 @@
FTS *fts;
FTSENT *p;
char *argv[] = { (char*) path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
PLOG(WARNING) << "Failed to fts_open " << path;
return -1;
}
diff --git a/cmds/installd/CacheTracker.cpp b/cmds/installd/CacheTracker.cpp
index ea0cd9e..a7242c3 100644
--- a/cmds/installd/CacheTracker.cpp
+++ b/cmds/installd/CacheTracker.cpp
@@ -103,7 +103,7 @@
FTS *fts;
FTSENT *p;
char *argv[] = { (char*) path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
PLOG(WARNING) << "Failed to fts_open " << path;
return;
}
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index f5f74bf..28ffdf1 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -661,7 +661,7 @@
auto ce_path = create_data_user_ce_path(uuid_, user);
auto de_path = create_data_user_de_path(uuid_, user);
char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
return error("Failed to fts_open");
}
while ((p = fts_read(fts)) != nullptr) {
@@ -786,7 +786,7 @@
};
LOG(DEBUG) << "Copying " << from << " to " << to;
- int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, NULL, false, true);
+ int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, true);
if (rc != 0) {
res = error(rc, "Failed copying " + from + " to " + to);
goto fail;
@@ -832,7 +832,7 @@
argv[7] = (char*) to.c_str();
LOG(DEBUG) << "Copying " << from << " to " << to;
- int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, NULL, false, true);
+ int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, true);
if (rc != 0) {
res = error(rc, "Failed copying " + from + " to " + to);
goto fail;
@@ -845,7 +845,7 @@
argv[7] = (char*) to.c_str();
LOG(DEBUG) << "Copying " << from << " to " << to;
- int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, NULL, false, true);
+ int rc = android_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, true);
if (rc != 0) {
res = error(rc, "Failed copying " + from + " to " + to);
goto fail;
@@ -868,20 +868,20 @@
// Nuke everything we might have already copied
{
auto to = create_data_app_package_path(to_uuid, data_app_name);
- if (delete_dir_contents(to.c_str(), 1, NULL) != 0) {
+ if (delete_dir_contents(to.c_str(), 1, nullptr) != 0) {
LOG(WARNING) << "Failed to rollback " << to;
}
}
for (auto user : users) {
{
auto to = create_data_user_de_package_path(to_uuid, user, package_name);
- if (delete_dir_contents(to.c_str(), 1, NULL) != 0) {
+ if (delete_dir_contents(to.c_str(), 1, nullptr) != 0) {
LOG(WARNING) << "Failed to rollback " << to;
}
}
{
auto to = create_data_user_ce_package_path(to_uuid, user, package_name);
- if (delete_dir_contents(to.c_str(), 1, NULL) != 0) {
+ if (delete_dir_contents(to.c_str(), 1, nullptr) != 0) {
LOG(WARNING) << "Failed to rollback " << to;
}
}
@@ -984,10 +984,10 @@
auto media_path = findDataMediaPath(uuid, user) + "/Android/data/";
char *argv[] = { (char*) ce_path.c_str(), (char*) de_path.c_str(),
(char*) media_path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
return error("Failed to fts_open");
}
- while ((p = fts_read(fts)) != NULL) {
+ while ((p = fts_read(fts)) != nullptr) {
if (p->fts_info == FTS_D && p->fts_level == 1) {
uid_t uid = p->fts_statp->st_uid;
if (multiuser_get_app_id(uid) == AID_MEDIA_RW) {
@@ -1337,11 +1337,11 @@
FTS *fts;
FTSENT *p;
char *argv[] = { (char*) path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
PLOG(ERROR) << "Failed to fts_open " << path;
return;
}
- while ((p = fts_read(fts)) != NULL) {
+ while ((p = fts_read(fts)) != nullptr) {
p->fts_number = p->fts_parent->fts_number;
switch (p->fts_info) {
case FTS_D:
@@ -1747,10 +1747,10 @@
FTSENT *p;
auto path = create_data_media_path(uuid_, userId);
char *argv[] = { (char*) path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
return error("Failed to fts_open " + path);
}
- while ((p = fts_read(fts)) != NULL) {
+ while ((p = fts_read(fts)) != nullptr) {
char* ext;
int64_t size = (p->fts_statp->st_blocks * 512);
switch (p->fts_info) {
@@ -1980,7 +1980,7 @@
}
} else {
if (S_ISDIR(libStat.st_mode)) {
- if (delete_dir_contents(libsymlink, 1, NULL) < 0) {
+ if (delete_dir_contents(libsymlink, 1, nullptr) < 0) {
res = error("Failed to delete " + _libsymlink);
goto out;
}
@@ -2022,14 +2022,14 @@
static void run_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd)
{
execl(kIdMapPath, kIdMapPath, "--fd", target_apk, overlay_apk,
- StringPrintf("%d", idmap_fd).c_str(), (char*)NULL);
+ StringPrintf("%d", idmap_fd).c_str(), (char*)nullptr);
PLOG(ERROR) << "execl (" << kIdMapPath << ") failed";
}
static void run_verify_idmap(const char *target_apk, const char *overlay_apk, int idmap_fd)
{
execl(kIdMapPath, kIdMapPath, "--verify", target_apk, overlay_apk,
- StringPrintf("%d", idmap_fd).c_str(), (char*)NULL);
+ StringPrintf("%d", idmap_fd).c_str(), (char*)nullptr);
PLOG(ERROR) << "execl (" << kIdMapPath << ") failed";
}
@@ -2080,7 +2080,7 @@
static int flatten_path(const char *prefix, const char *suffix,
const char *overlay_path, char *idmap_path, size_t N)
{
- if (overlay_path == NULL || idmap_path == NULL) {
+ if (overlay_path == nullptr || idmap_path == nullptr) {
return -1;
}
const size_t len_overlay_path = strlen(overlay_path);
@@ -2421,7 +2421,7 @@
std::to_string(shmSize));
}
auto data = std::unique_ptr<void, std::function<void (void *)>>(
- mmap(NULL, contentSize, PROT_READ, MAP_SHARED, verityInputAshmem.get(), 0),
+ mmap(nullptr, contentSize, PROT_READ, MAP_SHARED, verityInputAshmem.get(), 0),
[contentSize] (void* ptr) {
if (ptr != MAP_FAILED) {
munmap(ptr, contentSize);
diff --git a/cmds/installd/OWNERS b/cmds/installd/OWNERS
index 50440f1..5d4f176 100644
--- a/cmds/installd/OWNERS
+++ b/cmds/installd/OWNERS
@@ -1,7 +1,8 @@
set noparent
-calin@google.com
agampe@google.com
+calin@google.com
jsharkey@android.com
-toddke@google.com
+mathieuc@google.com
ngeoffray@google.com
+toddke@google.com
diff --git a/cmds/installd/dexopt.cpp b/cmds/installd/dexopt.cpp
index 03a411d..174ab21 100644
--- a/cmds/installd/dexopt.cpp
+++ b/cmds/installd/dexopt.cpp
@@ -190,9 +190,9 @@
strlcpy(buf, str, sizeof(buf));
char *pBuf = buf;
- while(strtok_r(pBuf, " ", &ctx) != NULL) {
+ while(strtok_r(pBuf, " ", &ctx) != nullptr) {
count++;
- pBuf = NULL;
+ pBuf = nullptr;
}
return count;
@@ -205,9 +205,9 @@
char *tok;
char *pBuf = buf;
- while((tok = strtok_r(pBuf, " ", &ctx)) != NULL) {
+ while((tok = strtok_r(pBuf, " ", &ctx)) != nullptr) {
argv[count++] = tok;
- pBuf = NULL;
+ pBuf = nullptr;
}
return count;
@@ -216,7 +216,7 @@
static const char* get_location_from_path(const char* path) {
static constexpr char kLocationSeparator = '/';
const char *location = strrchr(path, kLocationSeparator);
- if (location == NULL) {
+ if (location == nullptr) {
return path;
} else {
// Skip the separator character.
@@ -243,17 +243,17 @@
const char* relative_input_file_name = get_location_from_path(input_file_name);
char dex2oat_Xms_flag[kPropertyValueMax];
- bool have_dex2oat_Xms_flag = get_property("dalvik.vm.dex2oat-Xms", dex2oat_Xms_flag, NULL) > 0;
+ bool have_dex2oat_Xms_flag = get_property("dalvik.vm.dex2oat-Xms", dex2oat_Xms_flag, nullptr) > 0;
char dex2oat_Xmx_flag[kPropertyValueMax];
- bool have_dex2oat_Xmx_flag = get_property("dalvik.vm.dex2oat-Xmx", dex2oat_Xmx_flag, NULL) > 0;
+ bool have_dex2oat_Xmx_flag = get_property("dalvik.vm.dex2oat-Xmx", dex2oat_Xmx_flag, nullptr) > 0;
char dex2oat_threads_buf[kPropertyValueMax];
bool have_dex2oat_threads_flag = get_property(post_bootcomplete
? "dalvik.vm.dex2oat-threads"
: "dalvik.vm.boot-dex2oat-threads",
dex2oat_threads_buf,
- NULL) > 0;
+ nullptr) > 0;
char dex2oat_threads_arg[kPropertyValueMax + 2];
if (have_dex2oat_threads_flag) {
sprintf(dex2oat_threads_arg, "-j%s", dex2oat_threads_buf);
@@ -263,20 +263,20 @@
sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", instruction_set);
char dex2oat_isa_features[kPropertyValueMax];
bool have_dex2oat_isa_features = get_property(dex2oat_isa_features_key,
- dex2oat_isa_features, NULL) > 0;
+ dex2oat_isa_features, nullptr) > 0;
char dex2oat_isa_variant_key[kPropertyKeyMax];
sprintf(dex2oat_isa_variant_key, "dalvik.vm.isa.%s.variant", instruction_set);
char dex2oat_isa_variant[kPropertyValueMax];
bool have_dex2oat_isa_variant = get_property(dex2oat_isa_variant_key,
- dex2oat_isa_variant, NULL) > 0;
+ dex2oat_isa_variant, nullptr) > 0;
const char *dex2oat_norelocation = "-Xnorelocate";
bool have_dex2oat_relocation_skip_flag = false;
char dex2oat_flags[kPropertyValueMax];
int dex2oat_flags_count = get_property("dalvik.vm.dex2oat-flags",
- dex2oat_flags, NULL) <= 0 ? 0 : split_count(dex2oat_flags);
+ dex2oat_flags, nullptr) <= 0 ? 0 : split_count(dex2oat_flags);
ALOGV("dalvik.vm.dex2oat-flags=%s\n", dex2oat_flags);
// If we are booting without the real /data, don't spend time compiling.
@@ -287,18 +287,20 @@
(strcmp(vold_decrypt, "1") == 0)));
bool generate_debug_info = property_get_bool("debug.generate-debug-info", false);
+ const bool resolve_startup_strings =
+ property_get_bool("dalvik.vm.dex2oat-resolve-startup-strings", false);
char app_image_format[kPropertyValueMax];
char image_format_arg[strlen("--image-format=") + kPropertyValueMax];
bool have_app_image_format =
- image_fd >= 0 && get_property("dalvik.vm.appimageformat", app_image_format, NULL) > 0;
+ image_fd >= 0 && get_property("dalvik.vm.appimageformat", app_image_format, nullptr) > 0;
if (have_app_image_format) {
sprintf(image_format_arg, "--image-format=%s", app_image_format);
}
char dex2oat_large_app_threshold[kPropertyValueMax];
bool have_dex2oat_large_app_threshold =
- get_property("dalvik.vm.dex2oat-very-large", dex2oat_large_app_threshold, NULL) > 0;
+ get_property("dalvik.vm.dex2oat-very-large", dex2oat_large_app_threshold, nullptr) > 0;
char dex2oat_large_app_threshold_arg[strlen("--very-large-app-threshold=") + kPropertyValueMax];
if (have_dex2oat_large_app_threshold) {
sprintf(dex2oat_large_app_threshold_arg,
@@ -400,7 +402,7 @@
if (!have_dex2oat_compiler_filter_flag) {
char dex2oat_compiler_filter_flag[kPropertyValueMax];
have_dex2oat_compiler_filter_flag = get_property("dalvik.vm.dex2oat-filter",
- dex2oat_compiler_filter_flag, NULL) > 0;
+ dex2oat_compiler_filter_flag, nullptr) > 0;
if (have_dex2oat_compiler_filter_flag) {
sprintf(dex2oat_compiler_filter_arg,
"--compiler-filter=%s",
@@ -442,7 +444,7 @@
// supported.
const bool disable_cdex = !generate_compact_dex || (input_vdex_fd == output_vdex_fd);
- const char* argv[9 // program name, mandatory arguments and the final NULL
+ const char* argv[10 // program name, mandatory arguments and the final NULL
+ (have_dex2oat_isa_variant ? 1 : 0)
+ (have_dex2oat_isa_features ? 1 : 0)
+ (have_dex2oat_Xms_flag ? 2 : 0)
@@ -475,6 +477,8 @@
argv[i++] = oat_fd_arg;
argv[i++] = oat_location_arg;
argv[i++] = instruction_set_arg;
+ argv[i++] = resolve_startup_strings ? "--resolve-startup-const-strings=true" :
+ "--resolve-startup-const-strings=false";
if (have_dex2oat_isa_variant) {
argv[i++] = instruction_set_variant_arg;
}
@@ -552,7 +556,7 @@
argv[i++] = compilation_reason_arg.c_str();
}
// Do not add after dex2oat_flags, they should override others for debugging.
- argv[i] = NULL;
+ argv[i] = nullptr;
execv(dex2oat_bin, (char * const *)argv);
PLOG(ERROR) << "execv(" << dex2oat_bin << ") failed";
@@ -792,7 +796,7 @@
}
// Do not add after dex2oat_flags, they should override others for debugging.
- argv[i] = NULL;
+ argv[i] = nullptr;
execv(profman_bin, (char * const *)argv);
PLOG(ERROR) << "execv(" << profman_bin << ") failed";
@@ -948,7 +952,7 @@
for (const std::string& profman_arg : profman_args) {
argv[i++] = profman_arg.c_str();
}
- argv[i] = NULL;
+ argv[i] = nullptr;
execv(PROFMAN_BIN, (char * const *)argv);
PLOG(ERROR) << "execv(" << PROFMAN_BIN << ") failed";
@@ -1308,7 +1312,7 @@
}
char app_image_format[kPropertyValueMax];
bool have_app_image_format =
- get_property("dalvik.vm.appimageformat", app_image_format, NULL) > 0;
+ get_property("dalvik.vm.appimageformat", app_image_format, nullptr) > 0;
if (!have_app_image_format) {
return Dex2oatFileWrapper();
}
@@ -1629,7 +1633,7 @@
if (class_loader_context != nullptr) {
argv[i++] = class_loader_context_arg.c_str();
}
- argv[i] = NULL;
+ argv[i] = nullptr;
execv(dexoptanalyzer_bin, (char * const *)argv);
ALOGE("execv(%s) failed: %s\n", dexoptanalyzer_bin, strerror(errno));
diff --git a/cmds/installd/installd.cpp b/cmds/installd/installd.cpp
index 95ed2ff..673ff0d 100644
--- a/cmds/installd/installd.cpp
+++ b/cmds/installd/installd.cpp
@@ -107,7 +107,7 @@
DIR *dir;
struct dirent *dirent;
dir = opendir("/data/user");
- if (dir != NULL) {
+ if (dir != nullptr) {
while ((dirent = readdir(dir))) {
const char *name = dirent->d_name;
@@ -146,10 +146,10 @@
closedir(dir);
if (access(keychain_added_dir, F_OK) == 0) {
- delete_dir_contents(keychain_added_dir, 1, 0);
+ delete_dir_contents(keychain_added_dir, 1, nullptr);
}
if (access(keychain_removed_dir, F_OK) == 0) {
- delete_dir_contents(keychain_removed_dir, 1, 0);
+ delete_dir_contents(keychain_removed_dir, 1, nullptr);
}
}
diff --git a/cmds/installd/utils.cpp b/cmds/installd/utils.cpp
index 8672206..6b9cf0d 100644
--- a/cmds/installd/utils.cpp
+++ b/cmds/installd/utils.cpp
@@ -310,7 +310,7 @@
std::string path(create_data_path(volume_uuid) + "/" + SECONDARY_USER_PREFIX);
DIR* dir = opendir(path.c_str());
- if (dir == NULL) {
+ if (dir == nullptr) {
// Unable to discover other users, but at least return owner
PLOG(ERROR) << "Failed to opendir " << path;
return users;
@@ -340,13 +340,13 @@
FTSENT *p;
int64_t matchedSize = 0;
char *argv[] = { (char*) path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
if (errno != ENOENT) {
PLOG(ERROR) << "Failed to fts_open " << path;
}
return -1;
}
- while ((p = fts_read(fts)) != NULL) {
+ while ((p = fts_read(fts)) != nullptr) {
switch (p->fts_info) {
case FTS_D:
case FTS_DEFAULT:
@@ -469,7 +469,7 @@
continue;
}
subdir = fdopendir(subfd);
- if (subdir == NULL) {
+ if (subdir == nullptr) {
ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno));
close(subfd);
result = -1;
@@ -495,11 +495,11 @@
}
int delete_dir_contents(const std::string& pathname, bool ignore_if_missing) {
- return delete_dir_contents(pathname.c_str(), 0, NULL, ignore_if_missing);
+ return delete_dir_contents(pathname.c_str(), 0, nullptr, ignore_if_missing);
}
int delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing) {
- return delete_dir_contents(pathname.c_str(), 1, NULL, ignore_if_missing);
+ return delete_dir_contents(pathname.c_str(), 1, nullptr, ignore_if_missing);
}
int delete_dir_contents(const char *pathname,
@@ -511,7 +511,7 @@
DIR *d;
d = opendir(pathname);
- if (d == NULL) {
+ if (d == nullptr) {
if (ignore_if_missing && (errno == ENOENT)) {
return 0;
}
@@ -540,12 +540,12 @@
return -1;
}
d = fdopendir(fd);
- if (d == NULL) {
+ if (d == nullptr) {
ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno));
close(fd);
return -1;
}
- res = _delete_dir_contents(d, 0);
+ res = _delete_dir_contents(d, nullptr);
closedir(d);
return res;
}
@@ -573,7 +573,7 @@
}
DIR *ds = fdopendir(sdfd);
- if (ds == NULL) {
+ if (ds == nullptr) {
ALOGE("Couldn't fdopendir: %s\n", strerror(errno));
return -1;
}
@@ -619,18 +619,18 @@
uid_t group)
{
int res = 0;
- DIR *ds = NULL;
- DIR *dd = NULL;
+ DIR *ds = nullptr;
+ DIR *dd = nullptr;
ds = opendir(srcname);
- if (ds == NULL) {
+ if (ds == nullptr) {
ALOGE("Couldn't opendir %s: %s\n", srcname, strerror(errno));
return -errno;
}
mkdir(dstname, 0600);
dd = opendir(dstname);
- if (dd == NULL) {
+ if (dd == nullptr) {
ALOGE("Couldn't opendir %s: %s\n", dstname, strerror(errno));
closedir(ds);
return -errno;
@@ -964,11 +964,11 @@
FTS *fts;
FTSENT *p;
char *argv[] = { (char*) path.c_str(), nullptr };
- if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, NULL))) {
+ if (!(fts = fts_open(argv, FTS_PHYSICAL | FTS_NOCHDIR | FTS_XDEV, nullptr))) {
PLOG(ERROR) << "Failed to fts_open " << path;
return -1;
}
- while ((p = fts_read(fts)) != NULL) {
+ while ((p = fts_read(fts)) != nullptr) {
switch (p->fts_info) {
case FTS_DP:
if (chmod(p->fts_path, target_mode) != 0) {
@@ -1037,7 +1037,7 @@
}
DIR* subdir = fdopendir(subdir_fd);
- if (subdir == NULL) {
+ if (subdir == nullptr) {
PLOG(WARNING) << "Could not open dir path " << local_path;
result = false;
continue;
@@ -1055,7 +1055,7 @@
bool collect_profiles(std::vector<std::string>* profiles_paths) {
DIR* d = opendir(android_profiles_dir.c_str());
- if (d == NULL) {
+ if (d == nullptr) {
return false;
} else {
return collect_profiles(d, android_profiles_dir, profiles_paths);
diff --git a/libs/binder/ndk/include_ndk/android/binder_parcel.h b/libs/binder/ndk/include_ndk/android/binder_parcel.h
index d36b3c0..33c3f6c 100644
--- a/libs/binder/ndk/include_ndk/android/binder_parcel.h
+++ b/libs/binder/ndk/include_ndk/android/binder_parcel.h
@@ -50,98 +50,128 @@
*/
void AParcel_delete(AParcel* parcel) __INTRODUCED_IN(29);
-/**
- * This is called to allocate an array with a given length. If allocation fails, null should be
- * returned.
- */
-typedef void* (*AParcel_arrayReallocator)(void* vectorData, size_t length);
-
// @START-PRIMITIVE-VECTOR-GETTERS
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readInt32Array
*/
-typedef int32_t* (*AParcel_int32ArrayGetter)(void* arrayData);
+typedef int32_t* (*AParcel_int32Allocator)(void* arrayData, size_t length);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readUint32Array
*/
-typedef uint32_t* (*AParcel_uint32ArrayGetter)(void* arrayData);
+typedef uint32_t* (*AParcel_uint32Allocator)(void* arrayData, size_t length);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readInt64Array
*/
-typedef int64_t* (*AParcel_int64ArrayGetter)(void* arrayData);
+typedef int64_t* (*AParcel_int64Allocator)(void* arrayData, size_t length);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readUint64Array
*/
-typedef uint64_t* (*AParcel_uint64ArrayGetter)(void* arrayData);
+typedef uint64_t* (*AParcel_uint64Allocator)(void* arrayData, size_t length);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readFloatArray
*/
-typedef float* (*AParcel_floatArrayGetter)(void* arrayData);
+typedef float* (*AParcel_floatAllocator)(void* arrayData, size_t length);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readDoubleArray
*/
-typedef double* (*AParcel_doubleArrayGetter)(void* arrayData);
+typedef double* (*AParcel_doubleAllocator)(void* arrayData, size_t length);
/**
- * This is called to get the underlying data from an arrayData object.
+ * This allocates an array of length length inside of arrayData and returns whether or not there was
+ * a success.
*
- * This will never be called for an empty array.
+ * See also AParcel_readBoolArray
+ */
+typedef bool (*AParcel_boolAllocator)(void* arrayData, size_t length);
+
+/**
+ * This is called to get the underlying data from an arrayData object at index.
+ *
+ * See also AParcel_writeBoolArray
*/
typedef bool (*AParcel_boolArrayGetter)(const void* arrayData, size_t index);
/**
* This is called to set an underlying value in an arrayData object at index.
+ *
+ * See also AParcel_readBoolArray
*/
typedef void (*AParcel_boolArraySetter)(void* arrayData, size_t index, bool value);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readCharArray
*/
-typedef char16_t* (*AParcel_charArrayGetter)(void* arrayData);
+typedef char16_t* (*AParcel_charAllocator)(void* arrayData, size_t length);
/**
* This is called to get the underlying data from an arrayData object.
*
- * This will never be called for an empty array.
+ * The implementation of this function should allocate a contiguous array of length length and
+ * return that underlying buffer to be filled out. If there is an error or length is 0, null may be
+ * returned.
+ *
+ * See also AParcel_readByteArray
*/
-typedef int8_t* (*AParcel_byteArrayGetter)(void* arrayData);
+typedef int8_t* (*AParcel_byteAllocator)(void* arrayData, size_t length);
// @END-PRIMITIVE-VECTOR-GETTERS
/**
- * This is called to allocate a buffer
+ * This is called to allocate a buffer for a C-style string (null-terminated). The buffer should be
+ * of length length which includes space for the null-terminator.
*
- * The length here includes the space required to insert a '\0' for a properly formed c-str. If the
- * buffer returned from this function is retStr, it will be filled by AParcel_readString with the
- * data from the remote process, and it will be filled such that retStr[length] == '\0'.
+ * See also AParcel_readString.
*
* If allocation fails, null should be returned.
*/
-typedef void* (*AParcel_stringReallocator)(void* stringData, size_t length);
-
-/**
- * This is called to get the buffer from a stringData object.
- */
-typedef char* (*AParcel_stringGetter)(void* stringData);
+typedef char* (*AParcel_stringAllocator)(void* stringData, size_t length);
/**
* Writes an AIBinder to the next location in a non-null parcel. Can be null.
@@ -190,17 +220,12 @@
/**
* Reads and allocates string value from the next location in a non-null parcel.
*
- * Data is passed to the string allocator once the string size is known. This data should be used to
- * point to some kind of string data. For instance, it could be a char*, and the string allocator
- * could be realloc. Then the getter would simply be a cast to char*. In more complicated cases,
- * stringData could be a structure containing additional string data.
- *
- * If this function returns a success, the buffer returned by allocator when passed stringData will
- * contain a null-terminated c-str read from the binder.
+ * Data is passed to the string allocator once the string size is known. This size includes the
+ * space for the null-terminator of this string. This allocator returns a buffer which is used as
+ * the output buffer from this read.
*/
-binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator,
- AParcel_stringGetter getter, void** stringData)
- __INTRODUCED_IN(29);
+binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringAllocator allocator,
+ void* stringData) __INTRODUCED_IN(29);
// @START-PRIMITIVE-READ-WRITE
/**
@@ -331,6 +356,9 @@
/**
* Writes an array of bool to the next location in a non-null parcel.
+ *
+ * getter(arrayData, i) will be called for each i in [0, length) in order to get the underlying
+ * values to write to the parcel.
*/
binder_status_t AParcel_writeBoolArray(AParcel* parcel, const void* arrayData,
AParcel_boolArrayGetter getter, size_t length)
@@ -350,66 +378,93 @@
/**
* Reads an array of int32_t from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readInt32Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_int32ArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readInt32Array(const AParcel* parcel, void* arrayData,
+ AParcel_int32Allocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of uint32_t from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readUint32Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_uint32ArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readUint32Array(const AParcel* parcel, void* arrayData,
+ AParcel_uint32Allocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of int64_t from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readInt64Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_int64ArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readInt64Array(const AParcel* parcel, void* arrayData,
+ AParcel_int64Allocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of uint64_t from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readUint64Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_uint64ArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readUint64Array(const AParcel* parcel, void* arrayData,
+ AParcel_uint64Allocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of float from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readFloatArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_floatArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readFloatArray(const AParcel* parcel, void* arrayData,
+ AParcel_floatAllocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of double from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readDoubleArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_doubleArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readDoubleArray(const AParcel* parcel, void* arrayData,
+ AParcel_doubleAllocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of bool from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. Then, for every i in [0, length),
+ * setter(arrayData, i, x) will be called where x is the value at the associated index.
*/
-binder_status_t AParcel_readBoolArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
+binder_status_t AParcel_readBoolArray(const AParcel* parcel, void* arrayData,
+ AParcel_boolAllocator allocator,
AParcel_boolArraySetter setter) __INTRODUCED_IN(29);
/**
* Reads an array of char16_t from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readCharArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_charArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readCharArray(const AParcel* parcel, void* arrayData,
+ AParcel_charAllocator allocator) __INTRODUCED_IN(29);
/**
* Reads an array of int8_t from the next location in a non-null parcel.
+ *
+ * First, allocator will be called with the length of the array. If the allocation succeeds and the
+ * length is greater than zero, the buffer returned by the allocator will be filled with the
+ * corresponding data
*/
-binder_status_t AParcel_readByteArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_byteArrayGetter getter) __INTRODUCED_IN(29);
+binder_status_t AParcel_readByteArray(const AParcel* parcel, void* arrayData,
+ AParcel_byteAllocator allocator) __INTRODUCED_IN(29);
// @END-PRIMITIVE-READ-WRITE
diff --git a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
index bf0c956..6e41a7f 100644
--- a/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
+++ b/libs/binder/ndk/include_ndk/android/binder_parcel_utils.h
@@ -36,24 +36,26 @@
namespace ndk {
/**
- * This resizes a std::vector of some underlying type to the given length.
+ * This retrieves and allocates a vector to length length and returns the underlying buffer.
*/
template <typename T>
-static inline void* AParcel_stdVectorReallocator(void* vectorData, size_t length) {
+static inline T* AParcel_stdVectorAllocator(void* vectorData, size_t length) {
std::vector<T>* vec = static_cast<std::vector<T>*>(vectorData);
if (length > vec->max_size()) return nullptr;
vec->resize(length);
- return vec;
+ return vec->data();
}
/**
- * This retrieves the underlying contiguous vector from a corresponding vectorData.
+ * This allocates a vector to length length and returns whether the allocation is successful.
*/
-template <typename T>
-static inline T* AParcel_stdVectorGetter(void* vectorData) {
- std::vector<T>* vec = static_cast<std::vector<T>*>(vectorData);
- return vec->data();
+static inline bool AParcel_stdVectorBoolAllocator(void* vectorData, size_t length) {
+ std::vector<bool>* vec = static_cast<std::vector<bool>*>(vectorData);
+ if (length > vec->max_size()) return false;
+
+ vec->resize(length);
+ return true;
}
/**
@@ -89,8 +91,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<int32_t>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readInt32Array(parcel, &vectorData, &AParcel_stdVectorReallocator<int32_t>,
- AParcel_stdVectorGetter<int32_t>);
+ return AParcel_readInt32Array(parcel, vectorData, AParcel_stdVectorAllocator<int32_t>);
}
/**
@@ -105,8 +106,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<uint32_t>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readUint32Array(parcel, &vectorData, &AParcel_stdVectorReallocator<uint32_t>,
- AParcel_stdVectorGetter<uint32_t>);
+ return AParcel_readUint32Array(parcel, vectorData, AParcel_stdVectorAllocator<uint32_t>);
}
/**
@@ -121,8 +121,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<int64_t>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readInt64Array(parcel, &vectorData, &AParcel_stdVectorReallocator<int64_t>,
- AParcel_stdVectorGetter<int64_t>);
+ return AParcel_readInt64Array(parcel, vectorData, AParcel_stdVectorAllocator<int64_t>);
}
/**
@@ -137,8 +136,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<uint64_t>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readUint64Array(parcel, &vectorData, &AParcel_stdVectorReallocator<uint64_t>,
- AParcel_stdVectorGetter<uint64_t>);
+ return AParcel_readUint64Array(parcel, vectorData, AParcel_stdVectorAllocator<uint64_t>);
}
/**
@@ -153,8 +151,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<float>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readFloatArray(parcel, &vectorData, &AParcel_stdVectorReallocator<float>,
- AParcel_stdVectorGetter<float>);
+ return AParcel_readFloatArray(parcel, vectorData, AParcel_stdVectorAllocator<float>);
}
/**
@@ -169,8 +166,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<double>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readDoubleArray(parcel, &vectorData, &AParcel_stdVectorReallocator<double>,
- AParcel_stdVectorGetter<double>);
+ return AParcel_readDoubleArray(parcel, vectorData, AParcel_stdVectorAllocator<double>);
}
/**
@@ -186,7 +182,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<bool>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readBoolArray(parcel, &vectorData, &AParcel_stdVectorReallocator<bool>,
+ return AParcel_readBoolArray(parcel, vectorData, AParcel_stdVectorBoolAllocator,
AParcel_stdVectorSetter<bool>);
}
@@ -202,8 +198,7 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<char16_t>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readCharArray(parcel, &vectorData, &AParcel_stdVectorReallocator<char16_t>,
- AParcel_stdVectorGetter<char16_t>);
+ return AParcel_readCharArray(parcel, vectorData, AParcel_stdVectorAllocator<char16_t>);
}
/**
@@ -218,27 +213,18 @@
*/
inline binder_status_t AParcel_readVector(const AParcel* parcel, std::vector<int8_t>* vec) {
void* vectorData = static_cast<void*>(vec);
- return AParcel_readByteArray(parcel, &vectorData, &AParcel_stdVectorReallocator<int8_t>,
- AParcel_stdVectorGetter<int8_t>);
+ return AParcel_readByteArray(parcel, vectorData, AParcel_stdVectorAllocator<int8_t>);
}
// @END
/**
- * Takes a std::string and reallocates it to the specified length. For use with AParcel_readString.
- * See use below in AParcel_readString.
+ * Allocates a std::string to length and returns the underlying buffer. For use with
+ * AParcel_readString. See use below in AParcel_readString(const AParcel*, std::string*).
*/
-static inline void* AParcel_stdStringReallocator(void* stringData, size_t length) {
+static inline char* AParcel_stdStringAllocator(void* stringData, size_t length) {
std::string* str = static_cast<std::string*>(stringData);
str->resize(length - 1);
- return stringData;
-}
-
-/**
- * Takes a std::string and returns the inner char*.
- */
-static inline char* AParcel_stdStringGetter(void* stringData) {
- std::string* str = static_cast<std::string*>(stringData);
return &(*str)[0];
}
@@ -254,8 +240,7 @@
*/
static inline binder_status_t AParcel_readString(const AParcel* parcel, std::string* str) {
void* stringData = static_cast<void*>(str);
- return AParcel_readString(parcel, AParcel_stdStringReallocator, AParcel_stdStringGetter,
- &stringData);
+ return AParcel_readString(parcel, AParcel_stdStringAllocator, stringData);
}
template <typename T>
diff --git a/libs/binder/ndk/parcel.cpp b/libs/binder/ndk/parcel.cpp
index 7387d83..5ac3965 100644
--- a/libs/binder/ndk/parcel.cpp
+++ b/libs/binder/ndk/parcel.cpp
@@ -32,7 +32,10 @@
using ::android::status_t;
template <typename T>
-using ContiguousArrayGetter = T* (*)(void* arrayData);
+using ContiguousArrayAllocator = T* (*)(void* arrayData, size_t length);
+
+template <typename T>
+using ArrayAllocator = bool (*)(void* arrayData, size_t length);
template <typename T>
using ArrayGetter = T (*)(const void* arrayData, size_t index);
template <typename T>
@@ -81,8 +84,8 @@
}
template <typename T>
-binder_status_t ReadArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator, ContiguousArrayGetter<T> getter) {
+binder_status_t ReadArray(const AParcel* parcel, void* arrayData,
+ ContiguousArrayAllocator<T> allocator) {
const Parcel* rawParcel = parcel->get();
int32_t length;
@@ -91,12 +94,8 @@
if (status != STATUS_OK) return PruneStatusT(status);
if (length < 0) return STATUS_UNEXPECTED_NULL;
- *arrayData = reallocator(*arrayData, length);
- if (*arrayData == nullptr) return STATUS_NO_MEMORY;
-
+ T* array = allocator(arrayData, length);
if (length == 0) return STATUS_OK;
-
- T* array = getter(*arrayData);
if (array == nullptr) return STATUS_NO_MEMORY;
int32_t size = 0;
@@ -112,9 +111,8 @@
// Each element in a char16_t array is converted to an int32_t (not packed)
template <>
-binder_status_t ReadArray<char16_t>(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- ContiguousArrayGetter<char16_t> getter) {
+binder_status_t ReadArray<char16_t>(const AParcel* parcel, void* arrayData,
+ ContiguousArrayAllocator<char16_t> allocator) {
const Parcel* rawParcel = parcel->get();
int32_t length;
@@ -123,12 +121,8 @@
if (status != STATUS_OK) return PruneStatusT(status);
if (length < 0) return STATUS_UNEXPECTED_NULL;
- *arrayData = reallocator(*arrayData, length);
- if (*arrayData == nullptr) return STATUS_NO_MEMORY;
-
+ char16_t* array = allocator(arrayData, length);
if (length == 0) return STATUS_OK;
-
- char16_t* array = getter(*arrayData);
if (array == nullptr) return STATUS_NO_MEMORY;
int32_t size = 0;
@@ -163,9 +157,8 @@
}
template <typename T>
-binder_status_t ReadArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator, ArraySetter<T> setter,
- status_t (Parcel::*read)(T*) const) {
+binder_status_t ReadArray(const AParcel* parcel, void* arrayData, ArrayAllocator<T> allocator,
+ ArraySetter<T> setter, status_t (Parcel::*read)(T*) const) {
const Parcel* rawParcel = parcel->get();
int32_t length;
@@ -174,15 +167,14 @@
if (status != STATUS_OK) return PruneStatusT(status);
if (length < 0) return STATUS_UNEXPECTED_NULL;
- *arrayData = reallocator(*arrayData, length);
- if (*arrayData == nullptr) return STATUS_NO_MEMORY;
+ if (!allocator(arrayData, length)) return STATUS_NO_MEMORY;
for (size_t i = 0; i < length; i++) {
T readTarget;
status = (rawParcel->*read)(&readTarget);
if (status != STATUS_OK) return PruneStatusT(status);
- setter(*arrayData, i, readTarget);
+ setter(arrayData, i, readTarget);
}
return STATUS_OK;
@@ -255,8 +247,8 @@
return STATUS_OK;
}
-binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringReallocator reallocator,
- AParcel_stringGetter getter, void** stringData) {
+binder_status_t AParcel_readString(const AParcel* parcel, AParcel_stringAllocator allocator,
+ void* stringData) {
size_t len16;
const char16_t* str16 = parcel->get()->readString16Inplace(&len16);
@@ -278,16 +270,10 @@
return STATUS_BAD_VALUE;
}
- *stringData = reallocator(*stringData, len8);
-
- if (*stringData == nullptr) {
- return STATUS_NO_MEMORY;
- }
-
- char* str8 = getter(*stringData);
+ char* str8 = allocator(stringData, len8);
if (str8 == nullptr) {
- LOG(WARNING) << __func__ << ": AParcel_stringReallocator failed to allocate.";
+ LOG(WARNING) << __func__ << ": AParcel_stringAllocator failed to allocate.";
return STATUS_NO_MEMORY;
}
@@ -426,58 +412,50 @@
return WriteArray<int8_t>(parcel, value, length);
}
-binder_status_t AParcel_readInt32Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_int32ArrayGetter getter) {
- return ReadArray<int32_t>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readInt32Array(const AParcel* parcel, void* arrayData,
+ AParcel_int32Allocator allocator) {
+ return ReadArray<int32_t>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readUint32Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_uint32ArrayGetter getter) {
- return ReadArray<uint32_t>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readUint32Array(const AParcel* parcel, void* arrayData,
+ AParcel_uint32Allocator allocator) {
+ return ReadArray<uint32_t>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readInt64Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_int64ArrayGetter getter) {
- return ReadArray<int64_t>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readInt64Array(const AParcel* parcel, void* arrayData,
+ AParcel_int64Allocator allocator) {
+ return ReadArray<int64_t>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readUint64Array(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_uint64ArrayGetter getter) {
- return ReadArray<uint64_t>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readUint64Array(const AParcel* parcel, void* arrayData,
+ AParcel_uint64Allocator allocator) {
+ return ReadArray<uint64_t>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readFloatArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_floatArrayGetter getter) {
- return ReadArray<float>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readFloatArray(const AParcel* parcel, void* arrayData,
+ AParcel_floatAllocator allocator) {
+ return ReadArray<float>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readDoubleArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_doubleArrayGetter getter) {
- return ReadArray<double>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readDoubleArray(const AParcel* parcel, void* arrayData,
+ AParcel_doubleAllocator allocator) {
+ return ReadArray<double>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readBoolArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
+binder_status_t AParcel_readBoolArray(const AParcel* parcel, void* arrayData,
+ AParcel_boolAllocator allocator,
AParcel_boolArraySetter setter) {
- return ReadArray<bool>(parcel, arrayData, reallocator, setter, &Parcel::readBool);
+ return ReadArray<bool>(parcel, arrayData, allocator, setter, &Parcel::readBool);
}
-binder_status_t AParcel_readCharArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_charArrayGetter getter) {
- return ReadArray<char16_t>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readCharArray(const AParcel* parcel, void* arrayData,
+ AParcel_charAllocator allocator) {
+ return ReadArray<char16_t>(parcel, arrayData, allocator);
}
-binder_status_t AParcel_readByteArray(const AParcel* parcel, void** arrayData,
- AParcel_arrayReallocator reallocator,
- AParcel_byteArrayGetter getter) {
- return ReadArray<int8_t>(parcel, arrayData, reallocator, getter);
+binder_status_t AParcel_readByteArray(const AParcel* parcel, void* arrayData,
+ AParcel_byteAllocator allocator) {
+ return ReadArray<int8_t>(parcel, arrayData, allocator);
}
// @END
diff --git a/libs/binder/ndk/scripts/gen_parcel_helper.py b/libs/binder/ndk/scripts/gen_parcel_helper.py
index 2cf10d3..86cc57e 100755
--- a/libs/binder/ndk/scripts/gen_parcel_helper.py
+++ b/libs/binder/ndk/scripts/gen_parcel_helper.py
@@ -96,6 +96,10 @@
header += "/**\n"
header += " * Writes an array of " + cpp + " to the next location in a non-null parcel.\n"
+ if nca:
+ header += " *\n"
+ header += " * getter(arrayData, i) will be called for each i in [0, length) in order to get the underlying values to write "
+ header += "to the parcel.\n"
header += " */\n"
header += "binder_status_t AParcel_write" + pretty + "Array(AParcel* parcel, " + arg_type + ", size_t length) __INTRODUCED_IN(29);\n\n"
source += "binder_status_t AParcel_write" + pretty + "Array(AParcel* parcel, " + arg_type + ", size_t length) {\n"
@@ -105,48 +109,69 @@
for pretty, cpp in data_types:
nca = pretty in non_contiguously_addressable
- extra_getter_args = ""
- if nca: extra_getter_args = ", size_t index"
- getter_return = cpp + "*"
- if nca: getter_return = cpp
- getter_array_data = "void* arrayData"
- if nca: getter_array_data = "const void* arrayData"
-
+ read_func = "AParcel_read" + pretty + "Array"
+ write_func = "AParcel_write" + pretty + "Array"
+ allocator_type = "AParcel_" + pretty.lower() + "Allocator"
getter_type = "AParcel_" + pretty.lower() + "ArrayGetter"
setter_type = "AParcel_" + pretty.lower() + "ArraySetter"
- pre_header += "/**\n"
- pre_header += " * This is called to get the underlying data from an arrayData object.\n"
- pre_header += " *\n"
- pre_header += " * This will never be called for an empty array.\n"
- pre_header += " */\n"
- pre_header += "typedef " + getter_return + " (*" + getter_type + ")(" + getter_array_data + extra_getter_args + ");\n\n"
-
if nca:
pre_header += "/**\n"
+ pre_header += " * This allocates an array of length length inside of arrayData and returns whether or not there was "
+ pre_header += "a success.\n"
+ pre_header += " *\n"
+ pre_header += " * See also " + read_func + "\n"
+ pre_header += " */\n"
+ pre_header += "typedef bool (*" + allocator_type + ")(void* arrayData, size_t length);\n\n"
+
+ pre_header += "/**\n"
+ pre_header += " * This is called to get the underlying data from an arrayData object at index.\n"
+ pre_header += " *\n"
+ pre_header += " * See also " + write_func + "\n"
+ pre_header += " */\n"
+ pre_header += "typedef " + cpp + " (*" + getter_type + ")(const void* arrayData, size_t index);\n\n"
+
+ pre_header += "/**\n"
pre_header += " * This is called to set an underlying value in an arrayData object at index.\n"
+ pre_header += " *\n"
+ pre_header += " * See also " + read_func + "\n"
pre_header += " */\n"
pre_header += "typedef void (*" + setter_type + ")(void* arrayData, size_t index, " + cpp + " value);\n\n"
+ else:
+ pre_header += "/**\n"
+ pre_header += " * This is called to get the underlying data from an arrayData object.\n"
+ pre_header += " *\n"
+ pre_header += " * The implementation of this function should allocate a contiguous array of length length and "
+ pre_header += "return that underlying buffer to be filled out. If there is an error or length is 0, null may be "
+ pre_header += "returned.\n"
+ pre_header += " *\n"
+ pre_header += " * See also " + read_func + "\n"
+ pre_header += " */\n"
+ pre_header += "typedef " + cpp + "* (*" + allocator_type + ")(void* arrayData, size_t length);\n\n"
- read_using = "getter"
- if nca: read_using = "setter"
- read_type = getter_type
- if nca: read_type = setter_type
+ read_array_args = [("const AParcel*", "parcel")]
+ read_array_args += [("void*", "arrayData")]
+ read_array_args += [(allocator_type, "allocator")]
+ if nca: read_array_args += [(setter_type, "setter")]
- arguments = ["const AParcel* parcel"]
- arguments += ["void** arrayData"]
- arguments += ["AParcel_arrayReallocator reallocator"]
- arguments += [read_type + " " + read_using]
- arguments = ", ".join(arguments)
+ read_type_args = ", ".join((varType + " " + name for varType, name in read_array_args))
+ read_call_args = ", ".join((name for varType, name in read_array_args))
header += "/**\n"
header += " * Reads an array of " + cpp + " from the next location in a non-null parcel.\n"
+ header += " *\n"
+ if nca:
+ header += " * First, allocator will be called with the length of the array. Then, for every i in [0, length), "
+ header += "setter(arrayData, i, x) will be called where x is the value at the associated index.\n"
+ else:
+ header += " * First, allocator will be called with the length of the array. If the allocation succeeds and the "
+ header += "length is greater than zero, the buffer returned by the allocator will be filled with the corresponding data\n"
header += " */\n"
- header += "binder_status_t AParcel_read" + pretty + "Array(" + arguments + ") __INTRODUCED_IN(29);\n\n"
- source += "binder_status_t AParcel_read" + pretty + "Array(" + arguments + ") {\n"
+ header += "binder_status_t " + read_func + "(" + read_type_args + ") __INTRODUCED_IN(29);\n\n"
+ source += "binder_status_t " + read_func + "(" + read_type_args + ") {\n"
additional_args = ""
if nca: additional_args = ", &Parcel::read" + pretty
- source += " return ReadArray<" + cpp + ">(parcel, arrayData, reallocator, " + read_using + additional_args + ");\n";
+ source += " return ReadArray<" + cpp + ">(" + read_call_args + additional_args + ");\n";
source += "}\n\n"
cpp_helper += "/**\n"
@@ -165,9 +190,12 @@
cpp_helper += " void* vectorData = static_cast<void*>(vec);\n"
read_args = []
read_args += ["parcel"]
- read_args += ["&vectorData"]
- read_args += ["&AParcel_stdVectorReallocator<" + cpp + ">"]
- read_args += ["AParcel_stdVector" + read_using.capitalize() + "<" + cpp + ">"]
+ read_args += ["vectorData"]
+ if nca:
+ read_args += ["AParcel_stdVectorBoolAllocator"]
+ read_args += ["AParcel_stdVectorSetter<" + cpp + ">"]
+ else:
+ read_args += ["AParcel_stdVectorAllocator<" + cpp + ">"]
cpp_helper += " return AParcel_read" + pretty + "Array(" + ", ".join(read_args) + ");\n"
cpp_helper += "}\n\n"
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
index 21a9bce..b37b7fd 100644
--- a/services/inputflinger/InputReader.cpp
+++ b/services/inputflinger/InputReader.cpp
@@ -2645,7 +2645,7 @@
// Should not happen during first time configuration.
ALOGE("Cannot start a device in MODE_POINTER_RELATIVE, starting in MODE_POINTER");
mParameters.mode = Parameters::MODE_POINTER;
- // fall through.
+ [[fallthrough]];
case Parameters::MODE_POINTER:
mSource = AINPUT_SOURCE_MOUSE;
mXPrecision = 1.0f;
diff --git a/services/inputflinger/host/InputFlinger.cpp b/services/inputflinger/host/InputFlinger.cpp
index f1d3726..2da2a70 100644
--- a/services/inputflinger/host/InputFlinger.cpp
+++ b/services/inputflinger/host/InputFlinger.cpp
@@ -53,7 +53,7 @@
if ((uid != AID_SHELL)
&& !PermissionCache::checkPermission(sDumpPermission, pid, uid)) {
result.appendFormat("Permission Denial: "
- "can't dump SurfaceFlinger from pid=%d, uid=%d\n", pid, uid);
+ "can't dump InputFlinger from pid=%d, uid=%d\n", pid, uid);
} else {
dumpInternal(result);
}
diff --git a/vulkan/api/platform.api b/vulkan/api/platform.api
index 41f398d..a7c4c30 100644
--- a/vulkan/api/platform.api
+++ b/vulkan/api/platform.api
@@ -56,3 +56,6 @@
// VK_USE_PLATFORM_XLIB_XRANDR_EXT
@internal type u64 RROutput
+
+// VK_USE_PLATFORM_FUCHSIA
+@internal type u32 zx_handle_t
\ No newline at end of file
diff --git a/vulkan/api/vulkan.api b/vulkan/api/vulkan.api
index 5722810..e5b9b47 100644
--- a/vulkan/api/vulkan.api
+++ b/vulkan/api/vulkan.api
@@ -28,7 +28,7 @@
// API version (major.minor.patch)
define VERSION_MAJOR 1
define VERSION_MINOR 1
-define VERSION_PATCH 86
+define VERSION_PATCH 90
// API limits
define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
@@ -149,6 +149,10 @@
@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
+// 29
+@extension("VK_EXT_transform_feedback") define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1
+@extension("VK_EXT_transform_feedback") define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback"
+
// 34
@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
@@ -501,6 +505,10 @@
@extension("VK_KHR_bind_memory2") define VK_KHR_BIND_MEMORY2_SPEC_VERSION 1
@extension("VK_KHR_bind_memory2") define VK_KHR_BIND_MEMORY2_EXTENSION_NAME "VK_KHR_bind_memory2"
+// 159
+@extension("VK_EXT_image_drm_format_modifier") define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 1
+@extension("VK_EXT_image_drm_format_modifier") define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier"
+
// 161
@extension("VK_EXT_validation_cache") define VK_EXT_VALIDATION_CACHE_SPEC_VERSION 1
@extension("VK_EXT_validation_cache") define VK_EXT_VALIDATION_CACHE_EXTENSION_NAME "VK_EXT_validation_cache"
@@ -597,6 +605,22 @@
@extension("VK_KHR_vulkan_memory_model") define VK_KHR_VULKAN_MEMORY_MODEL_SPEC_VERSION 2
@extension("VK_KHR_vulkan_memory_model") define VK_KHR_VULKAN_MEMORY_MODEL_EXTENSION_NAME "VK_KHR_vulkan_memory_model"
+// 213
+@extension("VK_EXT_pci_bus_info") define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 1
+@extension("VK_EXT_pci_bus_info") define VK_EXT_PCI_BUS_INFO_EXENSION_NAME "VK_EXT_pci_bus_info"
+
+// 215
+@extension("VK_FUCHSIA_imagepipe_surface") define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
+@extension("VK_FUCHSIA_imagepipe_surface") define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
+
+// 224
+@extension("VK_GOOGLE_hlsl_functionality1") define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION 0
+@extension("VK_GOOGLE_hlsl_functionality1") define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1"
+
+// 225
+@extension("VK_GOOGLE_decorate_string") define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 0
+@extension("VK_GOOGLE_decorate_string") define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string"
+
/////////////
// Types //
/////////////
@@ -724,6 +748,9 @@
enum VkImageTiling {
VK_IMAGE_TILING_OPTIMAL = 0x00000000,
VK_IMAGE_TILING_LINEAR = 0x00000001,
+
+ //@extension("VK_EXT_image_drm_format_modifier") // 159
+ VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT = 1000158000,
}
enum VkImageViewType {
@@ -776,6 +803,9 @@
VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
+ //@extension("VK_EXT_transform_feedback") // 29
+ VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004,
+
//@extension("VK_NVX_raytracing") // 166
VK_QUERY_TYPE_COMPACTED_SIZE_NVX = 1000165000,
}
@@ -1447,6 +1477,11 @@
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
+ //@extension("VK_EXT_transform_feedback") // 29
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001,
+ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002,
+
//@extension("VK_AMD_texture_gather_bias_lod") // 42
VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000,
@@ -1722,6 +1757,14 @@
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR = 1000156004,
VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES_KHR = 1000156005,
+ //@extension("VK_EXT_image_drm_format_modifier") // 159
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT = 1000158000,
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT = 1000158002,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = 1000158003,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT = 1000158004,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158005,
+
//@extension("VK_KHR_bind_memory2") // 158
VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR = 1000157000,
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO_KHR = 1000157001,
@@ -1778,6 +1821,9 @@
//@extension("VK_KHR_shader_atomic_int64") // 181
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = 1000180000,
+ //@extension("VK_EXT_calibrated_timestamps") // 185
+ VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000,
+
//@extension("VK_KHR_driver_properties") // 197
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = 1000196000,
@@ -1795,6 +1841,12 @@
//@extension("VK_KHR_vulkan_memory_model") // 212
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
+
+ //@extension("VK_EXT_pci_bus_info") // 213
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000,
+
+ //@extension("VK_FUCHSIA_imagepipe_surface") // 215
+ VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000,
}
enum VkSubpassContents {
@@ -1857,14 +1909,17 @@
//@extension("VK_KHR_maintenance1") // 70
VK_ERROR_OUT_OF_POOL_MEMORY_KHR = 0xC4642878, // -1000069000
- //@extension("VK_EXT_global_priority") // 175
- VK_ERROR_NOT_PERMITTED_EXT = 0xC4628E4F, // -1000174001
-
//@extension("VK_KHR_external_memory") // 73
VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR = 0xC4641CBD, // -1000072003
+ //@extension("VK_EXT_image_drm_format_modifier") // 159
+ VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = 0xC462CCD0, // -1000158000
+
//@extension("VK_EXT_descriptor_indexing") // 162
VK_ERROR_FRAGMENTATION_EXT = 0xc462c118, // -1000161000
+
+ //@extension("VK_EXT_global_priority") // 175
+ VK_ERROR_NOT_PERMITTED_EXT = 0xC4628E4F, // -1000174001
}
enum VkDynamicState {
@@ -2282,6 +2337,14 @@
VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024,
}
+@extension("VK_EXT_calibrated_timestamps") // 185
+enum VkTimeDomainEXT {
+ VK_TIME_DOMAIN_DEVICE_EXT = 0,
+ VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1,
+ VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2,
+ VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3,
+}
+
@extension("VK_KHR_driver_properties") // 197
enum VkDriverIdKHR {
VK_DRIVER_ID_AMD_PROPRIETARY_KHR = 1,
@@ -2373,6 +2436,11 @@
//@extension("VK_NVX_raytracing") // 166
VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NVX = 0x00200000,
VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NVX = 0x00400000,
+
+ //@extension("VK_EXT_transform_feedback") // 29
+ VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000,
}
/// Buffer usage flags
@@ -2393,6 +2461,10 @@
//@extension("VK_NVX_raytracing") // 166
VK_BUFFER_USAGE_RAYTRACING_BIT_NVX = 0x00000400,
+
+ //@extension("VK_EXT_transform_feedback") // 29
+ VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800,
+ VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000,
}
/// Buffer creation flags
@@ -2666,6 +2738,12 @@
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = 0x00000010,
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = 0x00000020,
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = 0x00000040,
+
+ //@extension("VK_EXT_transform_feedback") // 29
+ VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT = 0x00000080,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT = 0x00000100,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0x00000200,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT = 0x00000400,
}
/// Sparse memory bind flags
@@ -2719,6 +2797,9 @@
//@extension("VK_NV_mesh_shader") // 203
VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = 0x00080000,
VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = 0x00100000,
+
+ //@extension("VK_EXT_transform_feedback") // 29
+ VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000,
}
/// Render pass attachment description flags
@@ -3149,6 +3230,12 @@
VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
}
+@extension("VK_EXT_transform_feedback") // 29
+type VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT
+//@extension("VK_EXT_transform_feedback") // 29
+//bitfield VkPipelineRasterizationStateStreamCreateFlagBitsEXT {
+//}
+
@extension("VK_NV_external_memory_capabilities") // 56
type VkFlags VkExternalMemoryHandleTypeFlagsNV
@extension("VK_NV_external_memory_capabilities") // 56
@@ -3426,6 +3513,12 @@
VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_NVX = 0x00000010,
}
+@extension("VK_FUCHSIA_imagepipe_surface") // 215
+type VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA
+//@extension("VK_FUCHSIA_imagepipe_surface") // 215
+//bitfield VkImagePipeSurfaceCreateFlagBitsFUCHSIA {
+//}
+
//////////////////
// Structures //
//////////////////
@@ -5360,6 +5453,38 @@
VkBuffer buffer
}
+@extension("VK_EXT_transform_feedback") // 29
+class VkPhysicalDeviceTransformFeedbackFeaturesEXT {
+ VkStructureType sType
+ void* pNext
+ VkBool32 transformFeedback
+ VkBool32 geometryStreams
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+class VkPhysicalDeviceTransformFeedbackPropertiesEXT {
+ VkStructureType sType
+ void* pNext
+ u32 maxTransformFeedbackStreams
+ u32 maxTransformFeedbackBuffers
+ VkDeviceSize maxTransformFeedbackBufferSize
+ u32 maxTransformFeedbackStreamDataSize
+ u32 maxTransformFeedbackBufferDataSize
+ u32 maxTransformFeedbackBufferDataStride
+ VkBool32 transformFeedbackQueries
+ VkBool32 transformFeedbackStreamsLinesTriangles
+ VkBool32 transformFeedbackRasterizationStreamSelect
+ VkBool32 transformFeedbackDraw
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+class VkPipelineRasterizationStateStreamCreateInfoEXT {
+ VkStructureType sType
+ const void* pNext
+ VkPipelineRasterizationStateStreamCreateFlagsEXT flags
+ u32 rasterizationStream
+}
+
@extension("VK_AMD_texture_gather_bias_lod") // 42
class VkTextureLODGatherFormatPropertiesAMD {
VkStructureType sType
@@ -6599,7 +6724,7 @@
const void* pNext
VkDebugUtilsMessengerCreateFlagsEXT flags
VkDebugUtilsMessageSeverityFlagsEXT messageSeverity
- VkDebugUtilsMessageTypeFlagsEXT messageType
+ VkDebugUtilsMessageTypeFlagsEXT messageTypes
PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback
void* pUserData
}
@@ -6925,6 +7050,55 @@
VkDeviceSize memoryOffset
}
+@extension("VK_EXT_image_drm_format_modifier") // 159
+class VkDrmFormatModifierPropertiesEXT {
+ u64 drmFormatModifier
+ u32 drmFormatModifierPlaneCount
+ VkFormatFeatureFlags drmFormatModifierTilingFeatures
+}
+
+@extension("VK_EXT_image_drm_format_modifier") // 159
+class VkDrmFormatModifierPropertiesListEXT {
+ VkStructureType sType
+ void* pNext
+ u32 drmFormatModifierCount
+ VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties
+}
+
+@extension("VK_EXT_image_drm_format_modifier") // 159
+class VkPhysicalDeviceImageDrmFormatModifierInfoEXT {
+ VkStructureType sType
+ const void* pNext
+ u64 drmFormatModifier
+ VkSharingMode sharingMode
+ u32 queueFamilyIndexCount
+ const u32* pQueueFamilyIndices
+}
+
+@extension("VK_EXT_image_drm_format_modifier") // 159
+class VkImageDrmFormatModifierListCreateInfoEXT {
+ VkStructureType sType
+ const void* pNext
+ u32 drmFormatModifierCount
+ const u64* pDrmFormatModifiers
+}
+
+@extension("VK_EXT_image_drm_format_modifier") // 159
+class VkImageDrmFormatModifierExplicitCreateInfoEXT {
+ VkStructureType sType
+ const void* pNext
+ u64 drmFormatModifier
+ u32 drmFormatModifierPlaneCount
+ const VkSubresourceLayout* pPlaneLayouts
+}
+
+@extension("VK_EXT_image_drm_format_modifier") // 159
+class VkImageDrmFormatModifierPropertiesEXT {
+ VkStructureType sType
+ void* pNext
+ u64 drmFormatModifier
+}
+
@extension("VK_EXT_validation_cache") // 161
class VkValidationCacheCreateInfoEXT {
VkStructureType sType
@@ -7253,6 +7427,13 @@
VkBool32 shaderSharedInt64Atomics
}
+@extension("VK_EXT_calibrated_timestamps") // 185
+class VkCalibratedTimestampInfoEXT {
+ VkStructureType sType
+ const void* pNext
+ VkTimeDomainEXT timeDomain
+}
+
@extension("VK_AMD_shader_core_properties") // 186
class VkPhysicalDeviceShaderCorePropertiesAMD {
VkStructureType sType
@@ -7314,7 +7495,7 @@
class VkPhysicalDeviceDriverPropertiesKHR {
VkStructureType sType
void* pNext
- u32 driverID
+ VkDriverIdKHR driverID
char[VK_MAX_DRIVER_NAME_SIZE_KHR] driverName
char[VK_MAX_DRIVER_INFO_SIZE_KHR] driverInfo
VkConformanceVersionKHR conformanceVersion
@@ -7413,6 +7594,24 @@
VkBool32 vulkanMemoryModelDeviceScope
}
+@extension("VK_EXT_pci_bus_info") // 213
+class VkPhysicalDevicePCIBusInfoPropertiesEXT {
+ VkStructureType sType
+ void* pNext
+ u16 pciDomain
+ u8 pciBus
+ u8 pciDevice
+ u8 pciFunction
+}
+
+@extension("VK_FUCHSIA_imagepipe_surface") // 215
+class VkImagePipeSurfaceCreateInfoFUCHSIA {
+ VkStructureType sType
+ const void* pNext
+ VkImagePipeSurfaceCreateFlagsFUCHSIA flags
+ platform.zx_handle_t imagePipeHandle
+}
+
////////////////
// Commands //
@@ -10334,6 +10533,62 @@
const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
}
+@extension("VK_EXT_transform_feedback") // 29
+cmd void vkCmdBindTransformFeedbackBuffersEXT(
+ VkCommandBuffer commandBuffer,
+ u32 firstBinding,
+ u32 bindingCount,
+ const VkBuffer* pBuffers,
+ const VkDeviceSize* pOffsets,
+ const VkDeviceSize* pSizes) {
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+cmd void vkCmdBeginTransformFeedbackEXT(
+ VkCommandBuffer commandBuffer,
+ u32 firstCounterBuffer,
+ u32 counterBufferCount,
+ const VkBuffer* pCounterBuffers,
+ const VkDeviceSize* pCounterBufferOffsets) {
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+cmd void vkCmdEndTransformFeedbackEXT(
+ VkCommandBuffer commandBuffer,
+ u32 firstCounterBuffer,
+ u32 counterBufferCount,
+ const VkBuffer* pCounterBuffers,
+ const VkDeviceSize* pCounterBufferOffsets) {
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+cmd void vkCmdBeginQueryIndexedEXT(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ u32 query,
+ VkQueryControlFlags flags,
+ u32 index) {
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+cmd void vkCmdEndQueryIndexedEXT(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ u32 query,
+ u32 index) {
+}
+
+@extension("VK_EXT_transform_feedback") // 29
+cmd void vkCmdDrawIndirectByteCountEXT(
+ VkCommandBuffer commandBuffer,
+ u32 instanceCount,
+ u32 firstInstance,
+ VkBuffer counterBuffer,
+ VkDeviceSize counterBufferOffset,
+ u32 counterOffset,
+ u32 vertexStride) {
+}
+
@extension("VK_AMD_draw_indirect_count") // 34
cmd void vkCmdDrawIndirectCountAMD(
VkCommandBuffer commandBuffer,
@@ -11128,6 +11383,14 @@
return ?
}
+@extension("VK_EXT_image_drm_format_modifier") // 159
+cmd VkResult vkGetImageDrmFormatModifierPropertiesEXT(
+ VkDevice device,
+ VkImage image,
+ VkImageDrmFormatModifierPropertiesEXT* pProperties) {
+ return ?
+}
+
@extension("VK_EXT_validation_cache") // 161
cmd VkResult vkCreateValidationCacheEXT(
VkDevice device,
@@ -11358,6 +11621,24 @@
u32 marker) {
}
+@extension("VK_EXT_calibrated_timestamps") // 185
+cmd VkResult vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(
+ VkPhysicalDevice physicalDevice,
+ u32* pTimeDomainCount,
+ VkTimeDomainEXT* pTimeDomains) {
+ return ?
+}
+
+@extension("VK_EXT_calibrated_timestamps") // 185
+cmd VkResult vkGetCalibratedTimestampsEXT(
+ VkDevice device,
+ u32 timestampCount,
+ const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+ u64* pTimestamps,
+ u64* pMaxDeviation) {
+ return ?
+}
+
@extension("VK_NV_mesh_shader") // 203
cmd void vkCmdDrawMeshTasksNV(
VkCommandBuffer commandBuffer,
@@ -11406,6 +11687,15 @@
VkCheckpointDataNV* pCheckpointData) {
}
+@extension("VK_FUCHSIA_imagepipe_surface") // 215
+cmd VkResult vkCreateImagePipeSurfaceFUCHSIA(
+ VkInstance instance,
+ const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkSurfaceKHR* pSurface) {
+ return ?
+}
+
////////////////
// Validation //
diff --git a/vulkan/include/vulkan/vulkan_core.h b/vulkan/include/vulkan/vulkan_core.h
index 39f4dc6..ac9bb66 100644
--- a/vulkan/include/vulkan/vulkan_core.h
+++ b/vulkan/include/vulkan/vulkan_core.h
@@ -43,11 +43,11 @@
#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff)
#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff)
// Version of this file
-#define VK_HEADER_VERSION 86
+#define VK_HEADER_VERSION 90
#define VK_NULL_HANDLE 0
-
+
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
@@ -60,7 +60,7 @@
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
#endif
#endif
-
+
typedef uint32_t VkFlags;
@@ -147,6 +147,7 @@
VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001,
VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
VK_ERROR_INVALID_SHADER_NV = -1000012000,
+ VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT = -1000158000,
VK_ERROR_FRAGMENTATION_EXT = -1000161000,
VK_ERROR_NOT_PERMITTED_EXT = -1000174001,
VK_ERROR_OUT_OF_POOL_MEMORY_KHR = VK_ERROR_OUT_OF_POOL_MEMORY,
@@ -297,6 +298,9 @@
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT = 1000028000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_PROPERTIES_EXT = 1000028001,
+ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_STREAM_CREATE_INFO_EXT = 1000028002,
VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000,
VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
@@ -398,6 +402,12 @@
VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_ADVANCED_STATE_CREATE_INFO_EXT = 1000148002,
VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_TO_COLOR_STATE_CREATE_INFO_NV = 1000149000,
VK_STRUCTURE_TYPE_PIPELINE_COVERAGE_MODULATION_STATE_CREATE_INFO_NV = 1000152000,
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT = 1000158000,
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT = 1000158002,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = 1000158003,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT = 1000158004,
+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158005,
VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000,
VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO_EXT = 1000161000,
@@ -428,6 +438,7 @@
VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = 1000180000,
+ VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT = 1000184000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_CORE_PROPERTIES_AMD = 1000185000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000,
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001,
@@ -443,6 +454,8 @@
VK_STRUCTURE_TYPE_CHECKPOINT_DATA_NV = 1000206000,
VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_NV = 1000206001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = 1000211000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PCI_BUS_INFO_PROPERTIES_EXT = 1000212000,
+ VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000,
VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT,
VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
@@ -811,6 +824,7 @@
typedef enum VkImageTiling {
VK_IMAGE_TILING_OPTIMAL = 0,
VK_IMAGE_TILING_LINEAR = 1,
+ VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT = 1000158000,
VK_IMAGE_TILING_BEGIN_RANGE = VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_TILING_END_RANGE = VK_IMAGE_TILING_LINEAR,
VK_IMAGE_TILING_RANGE_SIZE = (VK_IMAGE_TILING_LINEAR - VK_IMAGE_TILING_OPTIMAL + 1),
@@ -833,6 +847,7 @@
VK_QUERY_TYPE_OCCLUSION = 0,
VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
VK_QUERY_TYPE_TIMESTAMP = 2,
+ VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT = 1000028004,
VK_QUERY_TYPE_COMPACTED_SIZE_NVX = 1000165000,
VK_QUERY_TYPE_BEGIN_RANGE = VK_QUERY_TYPE_OCCLUSION,
VK_QUERY_TYPE_END_RANGE = VK_QUERY_TYPE_TIMESTAMP,
@@ -1428,6 +1443,7 @@
VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000,
+ VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000,
VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000,
VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = 0x00400000,
@@ -1447,6 +1463,10 @@
VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010,
VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020,
VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT = 0x00000080,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT = 0x00000100,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0x00000200,
+ VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT = 0x00000400,
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT,
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT,
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT,
@@ -1521,6 +1541,8 @@
VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040,
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080,
VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100,
+ VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_BUFFER_BIT_EXT = 0x00000800,
+ VK_BUFFER_USAGE_TRANSFORM_FEEDBACK_COUNTER_BUFFER_BIT_EXT = 0x00001000,
VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00000200,
VK_BUFFER_USAGE_RAYTRACING_BIT_NVX = 0x00000400,
VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
@@ -1643,6 +1665,9 @@
VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000,
+ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000,
VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000,
VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
@@ -6092,7 +6117,7 @@
typedef struct VkPhysicalDeviceDriverPropertiesKHR {
VkStructureType sType;
void* pNext;
- uint32_t driverID;
+ VkDriverIdKHR driverID;
char driverName[VK_MAX_DRIVER_NAME_SIZE_KHR];
char driverInfo[VK_MAX_DRIVER_INFO_SIZE_KHR];
VkConformanceVersionKHR conformanceVersion;
@@ -6359,6 +6384,95 @@
+#define VK_EXT_transform_feedback 1
+#define VK_EXT_TRANSFORM_FEEDBACK_SPEC_VERSION 1
+#define VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME "VK_EXT_transform_feedback"
+
+typedef VkFlags VkPipelineRasterizationStateStreamCreateFlagsEXT;
+
+typedef struct VkPhysicalDeviceTransformFeedbackFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 transformFeedback;
+ VkBool32 geometryStreams;
+} VkPhysicalDeviceTransformFeedbackFeaturesEXT;
+
+typedef struct VkPhysicalDeviceTransformFeedbackPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxTransformFeedbackStreams;
+ uint32_t maxTransformFeedbackBuffers;
+ VkDeviceSize maxTransformFeedbackBufferSize;
+ uint32_t maxTransformFeedbackStreamDataSize;
+ uint32_t maxTransformFeedbackBufferDataSize;
+ uint32_t maxTransformFeedbackBufferDataStride;
+ VkBool32 transformFeedbackQueries;
+ VkBool32 transformFeedbackStreamsLinesTriangles;
+ VkBool32 transformFeedbackRasterizationStreamSelect;
+ VkBool32 transformFeedbackDraw;
+} VkPhysicalDeviceTransformFeedbackPropertiesEXT;
+
+typedef struct VkPipelineRasterizationStateStreamCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineRasterizationStateStreamCreateFlagsEXT flags;
+ uint32_t rasterizationStream;
+} VkPipelineRasterizationStateStreamCreateInfoEXT;
+
+
+typedef void (VKAPI_PTR *PFN_vkCmdBindTransformFeedbackBuffersEXT)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes);
+typedef void (VKAPI_PTR *PFN_vkCmdBeginTransformFeedbackEXT)(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets);
+typedef void (VKAPI_PTR *PFN_vkCmdEndTransformFeedbackEXT)(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets);
+typedef void (VKAPI_PTR *PFN_vkCmdBeginQueryIndexedEXT)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index);
+typedef void (VKAPI_PTR *PFN_vkCmdEndQueryIndexedEXT)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index);
+typedef void (VKAPI_PTR *PFN_vkCmdDrawIndirectByteCountEXT)(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdBindTransformFeedbackBuffersEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstBinding,
+ uint32_t bindingCount,
+ const VkBuffer* pBuffers,
+ const VkDeviceSize* pOffsets,
+ const VkDeviceSize* pSizes);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBeginTransformFeedbackEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstCounterBuffer,
+ uint32_t counterBufferCount,
+ const VkBuffer* pCounterBuffers,
+ const VkDeviceSize* pCounterBufferOffsets);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdEndTransformFeedbackEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstCounterBuffer,
+ uint32_t counterBufferCount,
+ const VkBuffer* pCounterBuffers,
+ const VkDeviceSize* pCounterBufferOffsets);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBeginQueryIndexedEXT(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ uint32_t query,
+ VkQueryControlFlags flags,
+ uint32_t index);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdEndQueryIndexedEXT(
+ VkCommandBuffer commandBuffer,
+ VkQueryPool queryPool,
+ uint32_t query,
+ uint32_t index);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawIndirectByteCountEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t instanceCount,
+ uint32_t firstInstance,
+ VkBuffer counterBuffer,
+ VkDeviceSize counterBufferOffset,
+ uint32_t counterOffset,
+ uint32_t vertexStride);
+#endif
+
#define VK_AMD_draw_indirect_count 1
#define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
#define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
@@ -7341,7 +7455,7 @@
typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)(
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
- VkDebugUtilsMessageTypeFlagsEXT messageType,
+ VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
void* pUserData);
@@ -7676,6 +7790,65 @@
#define VK_EXT_POST_DEPTH_COVERAGE_EXTENSION_NAME "VK_EXT_post_depth_coverage"
+#define VK_EXT_image_drm_format_modifier 1
+#define VK_EXT_EXTENSION_159_SPEC_VERSION 0
+#define VK_EXT_EXTENSION_159_EXTENSION_NAME "VK_EXT_extension_159"
+#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 1
+#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier"
+
+typedef struct VkDrmFormatModifierPropertiesEXT {
+ uint64_t drmFormatModifier;
+ uint32_t drmFormatModifierPlaneCount;
+ VkFormatFeatureFlags drmFormatModifierTilingFeatures;
+} VkDrmFormatModifierPropertiesEXT;
+
+typedef struct VkDrmFormatModifierPropertiesListEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t drmFormatModifierCount;
+ VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties;
+} VkDrmFormatModifierPropertiesListEXT;
+
+typedef struct VkPhysicalDeviceImageDrmFormatModifierInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint64_t drmFormatModifier;
+ VkSharingMode sharingMode;
+ uint32_t queueFamilyIndexCount;
+ const uint32_t* pQueueFamilyIndices;
+} VkPhysicalDeviceImageDrmFormatModifierInfoEXT;
+
+typedef struct VkImageDrmFormatModifierListCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t drmFormatModifierCount;
+ const uint64_t* pDrmFormatModifiers;
+} VkImageDrmFormatModifierListCreateInfoEXT;
+
+typedef struct VkImageDrmFormatModifierExplicitCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint64_t drmFormatModifier;
+ uint32_t drmFormatModifierPlaneCount;
+ const VkSubresourceLayout* pPlaneLayouts;
+} VkImageDrmFormatModifierExplicitCreateInfoEXT;
+
+typedef struct VkImageDrmFormatModifierPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint64_t drmFormatModifier;
+} VkImageDrmFormatModifierPropertiesEXT;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetImageDrmFormatModifierPropertiesEXT)(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetImageDrmFormatModifierPropertiesEXT(
+ VkDevice device,
+ VkImage image,
+ VkImageDrmFormatModifierPropertiesEXT* pProperties);
+#endif
+
#define VK_EXT_validation_cache 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkValidationCacheEXT)
@@ -8296,6 +8469,46 @@
uint32_t marker);
#endif
+#define VK_EXT_calibrated_timestamps 1
+#define VK_EXT_CALIBRATED_TIMESTAMPS_SPEC_VERSION 1
+#define VK_EXT_CALIBRATED_TIMESTAMPS_EXTENSION_NAME "VK_EXT_calibrated_timestamps"
+
+
+typedef enum VkTimeDomainEXT {
+ VK_TIME_DOMAIN_DEVICE_EXT = 0,
+ VK_TIME_DOMAIN_CLOCK_MONOTONIC_EXT = 1,
+ VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT = 2,
+ VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT = 3,
+ VK_TIME_DOMAIN_BEGIN_RANGE_EXT = VK_TIME_DOMAIN_DEVICE_EXT,
+ VK_TIME_DOMAIN_END_RANGE_EXT = VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT,
+ VK_TIME_DOMAIN_RANGE_SIZE_EXT = (VK_TIME_DOMAIN_QUERY_PERFORMANCE_COUNTER_EXT - VK_TIME_DOMAIN_DEVICE_EXT + 1),
+ VK_TIME_DOMAIN_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkTimeDomainEXT;
+
+typedef struct VkCalibratedTimestampInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkTimeDomainEXT timeDomain;
+} VkCalibratedTimestampInfoEXT;
+
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT)(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains);
+typedef VkResult (VKAPI_PTR *PFN_vkGetCalibratedTimestampsEXT)(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceCalibrateableTimeDomainsEXT(
+ VkPhysicalDevice physicalDevice,
+ uint32_t* pTimeDomainCount,
+ VkTimeDomainEXT* pTimeDomains);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetCalibratedTimestampsEXT(
+ VkDevice device,
+ uint32_t timestampCount,
+ const VkCalibratedTimestampInfoEXT* pTimestampInfos,
+ uint64_t* pTimestamps,
+ uint64_t* pMaxDeviation);
+#endif
+
#define VK_AMD_shader_core_properties 1
#define VK_AMD_SHADER_CORE_PROPERTIES_SPEC_VERSION 1
#define VK_AMD_SHADER_CORE_PROPERTIES_EXTENSION_NAME "VK_AMD_shader_core_properties"
@@ -8516,6 +8729,31 @@
VkCheckpointDataNV* pCheckpointData);
#endif
+#define VK_EXT_pci_bus_info 1
+#define VK_EXT_PCI_BUS_INFO_SPEC_VERSION 1
+#define VK_EXT_PCI_BUS_INFO_EXTENSION_NAME "VK_EXT_pci_bus_info"
+
+typedef struct VkPhysicalDevicePCIBusInfoPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint16_t pciDomain;
+ uint8_t pciBus;
+ uint8_t pciDevice;
+ uint8_t pciFunction;
+} VkPhysicalDevicePCIBusInfoPropertiesEXT;
+
+
+
+#define VK_GOOGLE_hlsl_functionality1 1
+#define VK_GOOGLE_HLSL_FUNCTIONALITY1_SPEC_VERSION 0
+#define VK_GOOGLE_HLSL_FUNCTIONALITY1_EXTENSION_NAME "VK_GOOGLE_hlsl_functionality1"
+
+
+#define VK_GOOGLE_decorate_string 1
+#define VK_GOOGLE_DECORATE_STRING_SPEC_VERSION 0
+#define VK_GOOGLE_DECORATE_STRING_EXTENSION_NAME "VK_GOOGLE_decorate_string"
+
+
#ifdef __cplusplus
}
#endif
diff --git a/vulkan/libvulkan/api_gen.cpp b/vulkan/libvulkan/api_gen.cpp
index 629ebb1..df86af0 100644
--- a/vulkan/libvulkan/api_gen.cpp
+++ b/vulkan/libvulkan/api_gen.cpp
@@ -556,6 +556,7 @@
"vkGetDisplayModeProperties2KHR",
"vkGetDisplayPlaneCapabilities2KHR",
"vkGetInstanceProcAddr",
+ "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT",
"vkGetPhysicalDeviceDisplayPlaneProperties2KHR",
"vkGetPhysicalDeviceDisplayProperties2KHR",
"vkGetPhysicalDeviceExternalBufferProperties",
diff --git a/vulkan/libvulkan/code-generator.tmpl b/vulkan/libvulkan/code-generator.tmpl
index 1f4df1e..f04eb03 100644
--- a/vulkan/libvulkan/code-generator.tmpl
+++ b/vulkan/libvulkan/code-generator.tmpl
@@ -1149,6 +1149,7 @@
{{else if eq $ext "VK_EXT_direct_mode_display"}}true
{{else if eq $ext "VK_EXT_display_surface_counter"}}true
{{else if eq $ext "VK_EXT_display_control"}}true
+ {{else if eq $ext "VK_FUCHSIA_imagepipe_surface"}}true
{{else if eq $ext "VK_MVK_ios_surface"}}true
{{else if eq $ext "VK_MVK_macos_surface"}}true
{{else if eq $ext "VK_NN_vi_surface"}}true
diff --git a/vulkan/vkjson/vkjson.cc b/vulkan/vkjson/vkjson.cc
index efe622d..3da4336 100644
--- a/vulkan/vkjson/vkjson.cc
+++ b/vulkan/vkjson/vkjson.cc
@@ -325,6 +325,13 @@
}
};
+template <>
+struct EnumTraits<VkDriverIdKHR> {
+ static uint32_t min() { return VK_DRIVER_ID_BEGIN_RANGE_KHR; }
+ static uint32_t max() { return VK_DRIVER_ID_END_RANGE_KHR; }
+ static bool exist(uint32_t e) { return e >= min() && e <= max(); }
+};
+
// VkSparseImageFormatProperties
template <typename Visitor>
@@ -544,6 +551,31 @@
template <typename Visitor>
inline bool Iterate(Visitor* visitor,
+ VkJsonExtDriverProperties* properties) {
+ return visitor->Visit("driverPropertiesKHR",
+ &properties->driver_properties_khr);
+}
+
+template <typename Visitor>
+inline bool Iterate(Visitor* visitor,
+ VkPhysicalDeviceDriverPropertiesKHR* properties) {
+ return visitor->Visit("driverID", &properties->driverID) &&
+ visitor->Visit("driverName", &properties->driverName) &&
+ visitor->Visit("driverInfo", &properties->driverInfo) &&
+ visitor->Visit("conformanceVersion", &properties->conformanceVersion);
+}
+
+template <typename Visitor>
+inline bool Iterate(Visitor* visitor,
+ VkConformanceVersionKHR* version) {
+ return visitor->Visit("major", &version->major) &&
+ visitor->Visit("minor", &version->minor) &&
+ visitor->Visit("subminor", &version->subminor) &&
+ visitor->Visit("patch", &version->patch);
+}
+
+template <typename Visitor>
+inline bool Iterate(Visitor* visitor,
VkJsonExtVariablePointerFeatures* features) {
return visitor->Visit("variablePointerFeaturesKHR",
&features->variable_pointer_features_khr);
@@ -770,13 +802,19 @@
case VK_API_VERSION_1_0:
ret &= visitor->Visit("properties", &device->properties) &&
visitor->Visit("features", &device->features) &&
- visitor->Visit("VK_KHR_variable_pointers",
- &device->ext_variable_pointer_features) &&
visitor->Visit("memory", &device->memory) &&
visitor->Visit("queues", &device->queues) &&
visitor->Visit("extensions", &device->extensions) &&
visitor->Visit("layers", &device->layers) &&
visitor->Visit("formats", &device->formats);
+ if (device->ext_driver_properties.reported) {
+ ret &= visitor->Visit("VK_KHR_driver_properties",
+ &device->ext_driver_properties);
+ }
+ if (device->ext_variable_pointer_features.reported) {
+ ret &= visitor->Visit("VK_KHR_variable_pointers",
+ &device->ext_variable_pointer_features);
+ }
}
return ret;
}
diff --git a/vulkan/vkjson/vkjson.h b/vulkan/vkjson/vkjson.h
index 4f97c3e..450fb24 100644
--- a/vulkan/vkjson/vkjson.h
+++ b/vulkan/vkjson/vkjson.h
@@ -52,11 +52,23 @@
std::vector<VkExtensionProperties> extensions;
};
+struct VkJsonExtDriverProperties {
+ VkJsonExtDriverProperties() {
+ reported = false;
+ memset(&driver_properties_khr, 0,
+ sizeof(VkPhysicalDeviceDriverPropertiesKHR));
+ }
+ bool reported;
+ VkPhysicalDeviceDriverPropertiesKHR driver_properties_khr;
+};
+
struct VkJsonExtVariablePointerFeatures {
VkJsonExtVariablePointerFeatures() {
+ reported = false;
memset(&variable_pointer_features_khr, 0,
sizeof(VkPhysicalDeviceVariablePointerFeaturesKHR));
}
+ bool reported;
VkPhysicalDeviceVariablePointerFeaturesKHR variable_pointer_features_khr;
};
@@ -87,6 +99,7 @@
}
VkPhysicalDeviceProperties properties;
VkPhysicalDeviceFeatures features;
+ VkJsonExtDriverProperties ext_driver_properties;
VkJsonExtVariablePointerFeatures ext_variable_pointer_features;
VkPhysicalDeviceMemoryProperties memory;
std::vector<VkQueueFamilyProperties> queues;
diff --git a/vulkan/vkjson/vkjson_instance.cc b/vulkan/vkjson/vkjson_instance.cc
index 4ec442a..05d4dfe 100644
--- a/vulkan/vkjson/vkjson_instance.cc
+++ b/vulkan/vkjson/vkjson_instance.cc
@@ -71,11 +71,16 @@
const char* const* instance_extensions) {
VkJsonDevice device;
+ PFN_vkGetPhysicalDeviceProperties2KHR vkpGetPhysicalDeviceProperties2KHR =
+ nullptr;
PFN_vkGetPhysicalDeviceFeatures2KHR vkpGetPhysicalDeviceFeatures2KHR =
nullptr;
if (instance != VK_NULL_HANDLE &&
HasExtension("VK_KHR_get_physical_device_properties2",
instance_extension_count, instance_extensions)) {
+ vkpGetPhysicalDeviceProperties2KHR =
+ reinterpret_cast<PFN_vkGetPhysicalDeviceProperties2KHR>(
+ vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceProperties2KHR"));
vkpGetPhysicalDeviceFeatures2KHR =
reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures2KHR>(
vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFeatures2KHR"));
@@ -98,15 +103,32 @@
device.layers.data());
}
- vkGetPhysicalDeviceProperties(physical_device, &device.properties);
if (HasExtension("VK_KHR_get_physical_device_properties2",
instance_extension_count, instance_extensions)) {
+ VkPhysicalDeviceProperties2KHR properties = {
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR,
+ nullptr,
+ {} // properties
+ };
+ if (HasExtension("VK_KHR_driver_properties", device.extensions)) {
+ device.ext_driver_properties.reported = true;
+ device.ext_driver_properties.driver_properties_khr.sType =
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR;
+ device.ext_driver_properties.driver_properties_khr.pNext =
+ properties.pNext;
+ properties.pNext =
+ &device.ext_driver_properties.driver_properties_khr;
+ }
+ vkpGetPhysicalDeviceProperties2KHR(physical_device, &properties);
+ device.properties = properties.properties;
+
VkPhysicalDeviceFeatures2KHR features = {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR,
nullptr,
{} // features
};
if (HasExtension("VK_KHR_variable_pointers", device.extensions)) {
+ device.ext_variable_pointer_features.reported = true;
device.ext_variable_pointer_features.variable_pointer_features_khr.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR;
device.ext_variable_pointer_features.variable_pointer_features_khr.pNext =
@@ -117,6 +139,7 @@
vkpGetPhysicalDeviceFeatures2KHR(physical_device, &features);
device.features = features.features;
} else {
+ vkGetPhysicalDeviceProperties(physical_device, &device.properties);
vkGetPhysicalDeviceFeatures(physical_device, &device.features);
}
vkGetPhysicalDeviceMemoryProperties(physical_device, &device.memory);